• 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

No definition found for function in vendor vscode

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

Unable to get password for the instance created from AMI

How to to send mail using gmail in Laravel?

PHPExcel export HTML table to xlsx

Get lat/lon from google maps url ftid (hex)

Laravel update hasMany relationship using saveMany

mysql slow on updates for a well optimized query

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Unable to create lockable file - Laravel 8 & PHP 8

Custom post type single page not working

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

PHP rotate matrix counter-clockwise

About Contact Privacy policy Terms and conditions