• 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

What is my SQL missing?

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Symfony there are no commands defined in the "make" namespace

php file upload scanning using clamav, permissions on /tmp/

PHP: remove filename from path

Laravel - How to properly generate unique slugs from article titles?

Laravel 8 factory state afterCreating

disable two buttons after clicking another button

Symfony autowiring issues since docker update

How to delete old images from public folder on update using Laravel

Yii2: How to download backup files using spanjeta/yii2-backup?

best way to store error messages in Laravel (session or variable)

Access relation of pivot table in Laravel

PHP mail function is sending blank message body

PDOException SQLSTATE[HY000] [2002] No such file or directory

About Contact Privacy policy Terms and conditions