First off, I do know that there’s other threads about session variables disappearing. I’ve seen this one, for example. My question isn’t just, can session variables disappear.
My question is about the relationship between a session variable, and a user’s log-in session. In Laravel, I can get the current user by Auth::user().
Is it possible that, at minute 1 of a users login session, I set a session variable, like session(['x' => Auth::user()->id]) for example, and then at say minute 61, that user is still logged in, so Auth::user() is still returning the correct user, but now when I call session('x') that session variable has become unset?
Is the users login desynced from the session() variables? I thought a user was logged in through the session in the first place. But I’m getting situations where a user is still logged in, but some of my other custom session variables are disappearing, that’s the context for this question. It has me very confused.