Search code examples
phplaravelauthenticationsession-cookiessession-state

Laravel Login Issue - Session Cookies Not Passed?


First - coming back to this project - never saw this issue before so asking if anybody else has - when I set the project down it was working perfectly. Additionally - several other projects on the same server using the same setup are working flawlessly.

So problem is this. I login, the login is valid (I'm using DirectoryTree/Laravel to authenticate against LDAP, and have logs showing authentication was successful. All other projects are also using DirectoryTree/Laravel - and since the login is processing I cant see this being the root cause).

I'm immediately redirected back to the / (correct behavior) - but the login form returns instead of loading the vue components when auth:check = true.

I can hard refresh the page - and suddenly I'm logged in. (Must clear cache hard refresh at the browser) same action whether on Firefox, Chrome, Edge. The log in is processed - but its like the session isnt being updated.

I'm using the normal login form with the ui:auth setup.

Anybody ever seen this?


Solution

  • Turns out the issue was a web service worker I had forgotten I had on the HTTPS site. Best guess is its not recognizing that the site is online and is reloading information from the cache as it is a PWA application meant to be used on the internal network of the company. Once I removed the service worker - all was good. Never saw this action from it before so will investigate that further, but I have at least found the main error.

    Closing this question and shout out to @Wesley Smith for getting my brain working.