• 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 fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

Composer fails with kylekatarnls/update-helper on new homestead

Laravel Unknown Column 'updated_at'

Failing validation doesn't stop code execution in livewire component

Remove categories with all childs derived from parent category

Why does using salted hash on python and php give me different results?

PHP only Hit Counter?

Creating live search with AJAX and CodeIgniter

How can I resolve "Your requirements could not be resolved to an installable set of packages" error?

WHERE IN array binding in DB::raw laravel 5.4

Convert date and time to Jalali in Laravel

Best way to scrolldown onpageload

Get latest Tweets - What API

Add and update products to session cart in Laravel

Edit XML in HTML form and submit to self

About Contact Privacy policy Terms and conditions