Q: Laravel 5.0 Session can't use static methods I'm trying to create app with Laravel 5.0 and I have problem with using Session methods in my BaseController constructor
Here is my BaseController with it's consturctor.
use Symfony\Component\HttpFoundation\Session\Session;

class BaseController extends Controller {

    /**
     * Initializer.
     *
     * @access   public
     * @return \BaseController
     */
    public function __construct()
    {

        //set default lang
        if (!Session::has('lang')) {
            Session::put('lang', App::getLocale());
            Cookie::forever('lang', App::getLocale());
        } else {
            App::setLocale(Session::get('lang'));
        }


    }
}

but I get this error

ContextErrorException in BaseController.php line 22:
  Runtime Notice: Non-static method Symfony\Component\HttpFoundation\Session\Session::has() should not be called statically, assuming $this from incompatible context

Does anyone know what I'm doing wrong?

A: You're importing the wrong class. Symfony\Component\HttpFoundation\Session\Session is the class used by Laravel when you call the Session:: facade - but they're not the same class, and Symfony's session class doesn't use a static method for has(). I haven't used Laravel 5 myself, but I think it's in the top-level namespace.

A: Instead of:
use Symfony\Component\HttpFoundation\Session\Session;

you should use:
use Session;

to import Session here.

A: Instead of:
use Symfony\Component\HttpFoundation\Session\Session;
you can use as well:
use Illuminate\Support\Facades\Session;
