I am using laravel 5.4. In a method of a controller I have setting a value in session. If I call the dd() right after setting the session the dd() is showing all the session with the session I have just set. But if I fetch the session from another method the session is not available. If I remove the dd() from session setter method, I am getting the session properly.
My Code is as below:
public class TestController{
public function setSession(){
session(['test_key' => 'test_value']);//setting up the session
dd(session()->all());//getting the session properly here
}
public function showSession(){
dd(session()->all());//Here we are not getting the session
}
}
If we remove the dd() from setSession() session. Is it a bug of Laravel or it's intentional. I am interested to know the root cause of this fact. Thanks
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sra3S9
via IFTTT
Aucun commentaire:
Enregistrer un commentaire