• 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

How to check user Permissions using Custom Middleware in Laravel

sqlsrv_num_rows() expects parameter 1 to be resource, boolean given

How to to send mail using gmail in Laravel?

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

PHP: How to quickly split a key=value file into associative array

carbon generated datetime not stored correctly into the database

using random function but it's displaying duplicates

How to debug in WooCommerce 3+

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Natural ORDER in Laravel Eloquent ORM

Hi, I am making a contact form thingy, and my php isn't working any reason why?

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

How can I pass the list to the component variable in Laravel?

Clear javascript source cache laravel 5.8

How do I call Validator from a namespace with an already existing Validator class

About Contact Privacy policy Terms and conditions