• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

printing all running session variable in laravel 5.1

phplaravelframeworkslaravel-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

Related Snippets

"There is no active transaction" when refreshing database in Laravel 8.0 test

Exception thrown during the rendering of a template("Parameter "id" for route "url" must match "[^/]++" ("" given) to generate a corresponding URL.")

Can't exclude directories from .htaccess mobile redirect?

get folder directory from input type file - PHP

getting error while enter Command => php artisan route:list

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

How to use React Router with Laravel?

Search for array row with specific column value and return another value from qualifying row

Insert And Retrieve Data in MySQL with $.post Noob Question

could not find driver Debian SQL Server PHP

Remove country code from phone number?

Laravel 8: Array to string conversion while calling route:list

How to make Canonicals with PHP

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

I want to store data in new index as per my key in php [duplicate]

About Contact Privacy policy Terms and conditions