I am new in laravel. I am trying to save a session on page load. After page load when I am echoing the session it is coming properly. But when I am trying to fetch it in different page it is not coming.
I am using file
driver.
Added this line on the top of the controller use Illuminate\Support\Facades\Session;
Like this I am saving the sesion
if (Session::has('ss')) { //check session start
} else { Session::put('ss', $ss); Session::save(); }
If I do echo Session::get('ss')
after the above line it is working fine. But if I do echo Session::get('ss')
in another function or controller it is not coming.
NB : The problem is happening only on server. Local it is fine. I am using godaddy. I gave 777 permission to the session storage folder and subfolders but still no luck. My whole project got stuck only for this problem.
If I have to use memcache please guide me how to save session in that. I changed the driver file to memcache in the config/session.php
. Rest I kept same like
if (Session::has('ss')) { //check session start
} else { Session::put('ss', $ss); Session::save(); }
Still it is not working. Please help me on this.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire