• 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

retrieve data from database using session

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

PHP: convert all UTF-8 characters to HTML entities

MySQL order by field in Eloquent

Statement that checks whether a URL contains a particular path?

Composer Script echo

PHP usort() order in case of equality

Laravel 5 controller sending JSON integer as string

Laravel Carbon throws error The format separator does not match

Symfony Mercure "Failed to send an update"

hidden INPUT value not available in $_POST

Laravel implode array items to new lines

how to redirect the user back to desired URL after login page in PHP?

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Laravel - Implicit route model binding with soft deleted data

About Contact Privacy policy Terms and conditions