⭐ Alex ⭐ Well-known member Apr 30, 2020 #1 $app->session()->getSessionId(); gets a session id. How can one get a session knowing its id? I would need something such as $app->getSession($sessionId);
$app->session()->getSessionId(); gets a session id. How can one get a session knowing its id? I would need something such as $app->getSession($sessionId);
⭐ Alex ⭐ Well-known member May 1, 2020 #2 Update: I found this: $public_sessions = $app->container('session.public.storage'); $session = $public_sessions->getSession($sessionId); How ever, this returns a raw array from the database, now I need a way to get the user of this session.
Update: I found this: $public_sessions = $app->container('session.public.storage'); $session = $public_sessions->getSession($sessionId); How ever, this returns a raw array from the database, now I need a way to get the user of this session.
⭐ Alex ⭐ Well-known member May 1, 2020 #3 I suppose I can instantiate a new session object and use session.start($ipaddress), but it's unclear to me whether userId will get set.
I suppose I can instantiate a new session object and use session.start($ipaddress), but it's unclear to me whether userId will get set.
⭐ Alex ⭐ Well-known member May 1, 2020 #4 $session->start($ip); $userId = $session->get('userId'); nope, userId doesn't return anything.
⭐ Alex ⭐ Well-known member May 1, 2020 #5 Silly me, it was in the sessionData. $sessionData = $public_sessions->getSession($sessionId); $userId = $sessionData['userId']; Well thanks for your help everyone, today I learned how to get a session by id and get some info like the user!
Silly me, it was in the sessionData. $sessionData = $public_sessions->getSession($sessionId); $userId = $sessionData['userId']; Well thanks for your help everyone, today I learned how to get a session by id and get some info like the user!