• 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

Laravel Command Schedule Not Working Properly

Laravel Displaying image from database

I want to display default profile image if user do not have profile image

phpseclib 2.0 can not use Composer to create autoload

XDebug not working in VScode for php debugging

Laravel get user data with profile

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

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

PHP date() with timezone?

How to validate Envato Purchase Code in PHP

PHP function Not Working As Expected From functions.php Include File

Laravel Multi-language routes without prefix

How to execute sql code based on fetch array

PHP 8.1: strftime() is deprecated

Session timeout in Yii2

About Contact Privacy policy Terms and conditions