• 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 reset Laravel AuthManager/guards in between API calls in tests?

how to create html table in php

How to add automatically collapse/expand in content wordpress (single.php)?

Creating command to backup MySql database in Laravel

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

laravel 5.6 bulk inserting json data

GRPC installed successfully on ubuntu but php is looking for it in another folder

Return new collection without modifying original collection

PHP: Print caught exception like Xdebug

PHP web3 ERC20 token function call

Log file is not being written in Laravel 5.5

Laravel Blade checkbox not checked

JSON Render Issue in Date Object Laravel and PHP 7.4

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

loop through an anchor id

About Contact Privacy policy Terms and conditions