• 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 override header set in Apache config with more specific header in a virtual host

Group data in a multidimensional array based on two columns

How do I enable error reporting in Laravel?

Clients authentication and user authentication with laravel

How to KeyBy where multiple items have the same key

Google Gmail API - How to login programatically?

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Is there a way to use the same parameter into multiple place in the same query with Eloquent? [duplicate]

How to render html from a @foreach loop in a textarea

Remove categories with all childs derived from parent category

Make Calculator - When Button clicked the No shows in Textbox.

Call to undefined function openssl_decrypt

"There is no active transaction" when refreshing database in Laravel 8.0 test

Symfony/Form add attribute based on the data

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

About Contact Privacy policy Terms and conditions