bennysantoso
bennysantoso

Reputation: 1213

How to get laravel_session in Laravel 5.2?

Is there a way to get laravel_session and show it in my Controller?

enter image description here

FYI, I use laravel 5.2.

Thank you!

Upvotes: 1

Views: 1430

Answers (2)

Alex Lapin
Alex Lapin

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

Saumya Rastogi
Saumya Rastogi

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

Related Questions