Did you remove all the cookies from the browser? It might be possible that it searches for something that doesn't excist. So clear the cache and cookie history!
Laravel 5 session coockie
hello guy's,
In a current project i would like to change the default laravel session cookie name to something custom.
I went to /app/config/session.php and changed
'cookie' => 'laravel_session',
When i visit the site, i can see that the session cookie name was changed, but ... all of my forms give me a token mismatch error on submit after these change.
Can somebody help me with this small and probably noobish error?
Greetz
VikingCode
yep ... i did that ...
But still after reading your post I tried again ...
Console -> php artisan cache:clear Chrome -> incognito window -> http://.... -> submit form
all of my forms give me a 'token mismatch' error on submit after these change.
I've changed the name on mine and it's fine, worked straight away after a refresh. Probably related to another problem with the actual value of _token not being sent/read.
it did fix it self :) so big thx for your time guy's ...
What was the fix?
i don't really know .. i have tried like 1000 things ... nothing helped... after i gave hope to ever fix it :p i went home .. @ home a bit later, it worked from the first time ... i actually didn't changed anything ... it just worked ... i tested it on 2 other vps and it did work there too.... so euhm .. you tell me ?
hi me back ... with the same problem all over again ...but this time i broke it @ home 2 :p
so when you change it for the first time .. it works great ... but when i wanted to change it to something permanent i get the same error ... again ... i have cleared all cache (artisan) , did composer update, i opened an incognito window ... and at form ( any form ) submit i get the same token mismatch error again.
i deleted my project ... pulled it back from git ... and everything was ok ... i changed the session name ... and back the same error....
i deleted my project ... pulled it 4 the 3th time.... changed my session name ... and test it back in the browser ... this time no token mismatch ... but when i try to change it , i get back to the same token mismatch page ...
Do i forget to clean some cache elsewhere ?
You got a development link or anything we can test?
What environment did you run composer install? If production has it cached your config in storage.
I'm also having problems with this issue. Have been looking for info all day and no luck.
No matter the driver I use (redis, file, database...)... It works perfect, however, when I pick the cookie driver, the sessions are lost after any redirect.
@bashy | euhm .. i will put my private git repo to public for 48h: https://bitbucket.org/maravillos/maravillos-0.0.2
@tomrburgess | i just use composer update & cleaned my storage folder structure manually
@Viking can't find anything that could be wrong since it's just the Laravel installation with some packages and migrations, nothing else...
yes indeed it is verry strange ... every time i pull it on my pc now i get the same error ... however ... if check my token in storage/framework/session ... i clearly see a session there ... if open it, and compare it to the token in developers tools of chrome ... the token is the same .. but when i submit it ... i get the token mismatch error ... so strange ...
Is it normal that after submit of a form of just browse to another page it then generates 2 some times more sessions inside sessions folder ?
actually after the first visit of the first page (then its just generate one) its generates multiple sessions files inside sessions folder ... and always random amount .. :s
You do know your / route is creating a user every time?
Sentry::register(array(
'email' => 'john.doe@example.com',
'password' => 'foobar',
'type_id' => 1
));
Surely that's why the session regenerates?
Woow @bashy good catch :P
Please or to participate in this conversation.