• 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

Can I write PHP code across multiple lines per statement?

Laravel 5 controller sending JSON integer as string

Get sum of arrays inside array

Python - Include another Python script

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Extract house numbers from address string

Check if user online laravel

PHP Deprecated issue when running artisan command

How to make a array inside array?

Issue saving card for customer

Unable to run composer install

Problem with fetching data from database in Laravel

How to convert binary string to normal string in php

About Contact Privacy policy Terms and conditions