printing all running session variable in laravel 5.1
PHP Snippet 1:
dd(session()->all());
PHP Snippet 2:
$data = session()->all();
PHP Snippet 3:
$sessions=session()->all();
PHP Snippet 4:
$sessions=Session::all();
PHP Snippet 5:
foreach($sessions as $k=>$v){
echo $k."=".$v." ";
}
//or use :
dd(session()->all()) ; // this is var_dump equeivelent
PHP Snippet 6:
$user_id = session('user_id'); // key : user_id