• 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

how to display a view on laravel 8 and not have a 404 NOT FOUND page?

Laravel 5.2: Unable to locate factory with name [default]

image source not readable

Send POST data via raw JSON with Postman

Change user role if checkout custom checkbox is checked in WooCommerce

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

How to get array values using foreach in laravel

find in set in laravel ? example

Laravel Sanctum CSRF not authenticating

How do I do HTTP basic authentication using Guzzle?

Assets not referencing to public folder (Laravel)

how to fix Service provider class not found when using repository?

how to remove white space in select 2

Convert PHP array into HTML tag attributes separated by spaces

Laravel phpunit test failing authorization

About Contact Privacy policy Terms and conditions