• 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 KeyBy where multiple items have the same key

Guzzle Not Sending Grant Type to Laravel Passport

Laravel Excel::store file empty after stored

oauth-private.key does not exist or is not readable

Laravel 8: Array to string conversion while calling route:list

how to search for a file with php

Handling expired token in Laravel

Can't exclude directories from .htaccess mobile redirect?

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

Must be of the type array, null given,

Sentry + Laravel: how to log an already catched Exception?

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

wp_remote_get() not passing authentication

how to sort by a custom appended relation to model

Issue saving card for customer

About Contact Privacy policy Terms and conditions