Support the ongoing development of Laravel.io →
posted 10 years ago
Session

I working on localhost and using ajax post to update the account user data, Its update from database and session too but when I refresh page it showing old session data.

Here is code
$dealer_data = dtbl::select()->where('d_id',$d_id)->get()->toArray();
Session::forget('dealer_data');
Session::put('dealer_data',$dealer_data);

Here I print 
Session::all(); its work fine showing updated session,

but when I refresh page and print Session::all(); its return old session data.

Here is session config

'driver' => 'cookie'
'lifetime' => 120,
'expire_on_close' => false,
'files' => storage_path().'/sessions',
'connection' => null,
'table' => 'sessions',
'lottery' => array(2, 100),
'cookie' => 'laravel_session',
'path' => '/', /// I AM WORKING ON LOCAL HOST
'domain' => '',
'secure' => false,
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ninteen81 ninteen81 Joined 20 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.