How to avoid caching in the socket?
I've executed a script listening for sockets, so there I check if the user is logged or not:
Auth::check();
i've tested it, but if I logout or log in ,the status doesn't changes, also this happens with the database eloquent queries, the fluent works fine, any ideas on how to fix this problem?
I need to restart the server to update the session in the sockets, that restart
also I've tried to use raw $_SESSION
, it also caches, but I need to check the fresh version of it in the sockets...how to do this?, spent hours but still can't figure it out
I think you have to overwrite the user() Method inside the Guard class. The method originally fetches the user only once per request and you have to disable that for your usecase. See here from Guard.php
// If we have already retrieved the user for the current request we can just
// return it back immediately. We do not want to pull the user data every
// request into the method becaue that would tremendously slow the app.
if ( ! is_null($this->user))
{
return $this->user;
}