I developed an app that needs users sign in. And the app keeps the session_id
in the sandbox, so I just hope when session_id
posted to the server, user_id
can be get again by $_SESSION['id']
.
Here's the code:
session_id($_POST["session_id"]);
session_start();
$user_id = session_id($_POST["user_id"]);
If users sign in, users can get the data they need in about 4 hours. But after several hours, users can not get any data.
I found it's because session_id($_POST["user_id"]) = nil
.
I have set the session_gc_maxlifetime
to 999999999
. I restart the server.
However it doesn't work.