• 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

PHP | "The requested PHP extension bcmath is missing from your system."

Get data from accuweather api url

Custom post type single page not working

protect my blog content

Project structure for PHP

How to get multiple values with same key from an array PHP

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

Laravel MSSQL Server Connection not working

How to test laravel controller method?

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

Laravel Blade checkbox not checked

cakephp save drag and drop list order to database

PHP array sort and remove duplicates by two field values

Symfony 4: "Autowire: you should configure its value explicitly."

Respond with status code 401 on authentication failure using Laravel and Passport?

About Contact Privacy policy Terms and conditions