use ci_sessions in Laravel code example Example 1: session flash session()->flash('key', 'value'); Example 2: session laravel session(['name' => 'data']);