• 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

Composer Warning: openssl extension is missing. How to enable in WAMP

Don't show recurring price for WooCommerce subscriptions worth 0$

Using spatie/media-library, how to rename a collection of uploaded files?

How to make autocomplete work in foreach php loop? (vscode, intellisense)

PHP how to detect if running on arm64 cpu?

how to identify the web server name of remote host

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

how to remove white space in select 2

Call to a member function fetch_field() on a non-object MySQLiDB

How to install php yaml on CentOs?

Sum column values from multiple arrays

LARAVEL: How to fetch id dynamically in a query builder?

Laravel print last executed SQL query with Query log

Google Calendar API batch request PHP

How to convert binary string to normal string in php

About Contact Privacy policy Terms and conditions