Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

peterlee's avatar

session store request from mobile application

Hi, I recently develop login process on an android application and faced some problem.

I use file based session on Laravel and I also used middleware as

\Illuminate\Session\Middleware\StartSession::class,

in order to properly store session on storage/frameworks/session.php.

it works fine only when I store session from Postman or browser.

but when I request exactly same URL and body into that,

a session does not seem to stored as expected.

the code I used in order to store session is like

$sessionKey = Hash::make($user->uid); session( [ $sessionKey => $user ] );

and as app user returns the session key value as the response in order to use it as the token.

but for some reason

$customer = session( $sessionKey, null)

the session value, $customer, always returns null when it called from android app, but still from PostMan does work and successfully returns $user info

could you expect what's problem here?

Thank you in advance.

0 likes
0 replies

Please or to participate in this conversation.