• 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

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

IlluminateDatabaseQueryException could not find driver [duplicate]

laravel and phpunit: could not find driver (SQL: PRAGMA foreign_keys = ON;)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

how to remove %20 in the url in php

How to get transaction details in notify_url page in paypal

how to upload binary image to sql server using php laravel

Laravel relationship belongsToMany with composite primary keys

how to sort by a custom appended relation to model

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

dockerizing Laravel + vue

Laravel Sanctum CSRF not authenticating

How to fix bootstrap multiselect search data using ajax

Laravel after login Two factor not working

In PHP, which is faster: preg_split or explode?

About Contact Privacy policy Terms and conditions