Getting the Session Store Used for Authentication

Problem

You want to access the session store used by authentication.

Solution

Use the Auth::getSession() method.

$request = Auth::getSession();

Discussion

Usually you can just access the Session facade.

By default Laravel uses the same session store for both the Session facade and the Auth facade. This means unless your application is explicitly setting the session store, it's easier to use the Session facade.

comments powered by Disqus