• 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

PHP only Hit Counter?

Yii Ajax Submit button

carbon generated datetime not stored correctly into the database

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

Passing a boolean value from checkbox in Laravel form

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

How to get the ID of the link in another page in php

Querying only one row from a one to many relationship laravel

How update php.ini on a Mac OS X Mojave?

Laravel Blade checkbox not checked

Display a success custom notice after Placing an Order in WooCommerce

How to change the app environment at run time?

Display the default discounted price and percentage on Woocommerce products

Nginx RTMP not recording

About Contact Privacy policy Terms and conditions