Reputation: 1213
Is there a way to get laravel_session and show it in my Controller?
FYI, I use laravel 5.2.
Thank you!
Upvotes: 1
Views: 1430
Reputation: 51
May be it's too late, but hope this helps someone like me. In Laravel 5.6 it working that way:
function __construct(Request $request) {
dd($request->cookie('laravel_session'));
}
Upvotes: 3
Reputation: 13693
Yes you can use session()
method to get the session inside controller like this:
$session_array = session()->all();
Hope this helps!
Upvotes: 0