Member Since 4 Years Ago
1,415 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Thanks Bashy, That does appear to fix the problem. I have update the repo with the fix if anyone wants to see what I had to change.
Ok so I created a laravel repo with a basic recreation of my problem. https://github.com/valeryan/L5sessiontest The readme explains the setup.
Yes the encrypted token is passed in the header and the sessions are all being created under .example.com domain. The token mismatch is because Laravel is generating a new session with each request. If i disable token verification I still get the problem with a new session for each ajax request. Thanks for the replies though. I will try to put together a small code test that showcases the problem better.
valeryan started a new conversation L5 - Request To A Subdomain Is Causing The Session To Be Regenerated
EDIT - I created a git repo that show this problem in action. https://github.com/valeryan/L5sessiontest
TLDR - Session are not working across subdomains for me in L5 with session domain set to .example.com
So I have been building some test applications using the Laravel development branch. My application has a main domain like 'example.com' and a Restful API at 'api.example.com'. Anytime I try to make a request to the API I get a token mismatch exception. I disable the verify token middleware of course my request goes through. I could not find any weird problems with any of the code that handles all the verification stuff on the Laravel side, but when I opened the session storage folder in my application I had like 50 session files. I noticed that anytime I refreshed a page with an api request in it a new session gets generated. if the page has 2 request two new session get generated ect... The request are made via ajax. I can move my API routes to example.com/api and session work just fine. I can browse to api.example.com and session work find that way. I have a session domain set to .example.com in my config so that the session is shared between these domians. The API and main site are running on the same Laravel code that I just download form git yesterday. I am also passing CORS headers to allow the request. if I turn of the token verification the calls work but the session is still regenerated so things like auth don't persist.
I did not have any issues with dividing up my API like this in L4. Has anyone else ran into an issue like this with Laravel 5?