Reputation: 282875
\Console::log('session_statusxxx',session_status(),ini_get('session.use_trans_sid'));
if(!session_regenerate_id(true)) { // user attempted to log in; create a new session for him
throw new \Exception("Could not regenerate session ID");
}
\Console::log('session_statusxxx',session_status());
I'm hitting that exception -- i.e., session_regenerate_id
is returning false
.
Just prior to calling session_regenerate_id
I can see that session_status()
is 2
which is PHP_SESSION_ACTIVE
, and session.use_trans_sid
is "0"
.
Shouldn't session_regenerate_id
destroy the active session and start a new one?
Upvotes: 0
Views: 400
Reputation: 282875
Double check your implementation of SessionHandlerInterface
if you're using session_set_save_handler
. In my case, I was returning the wrong value from a few of the functions. e.g., read
should return an empty string if there's no session, not false
, destroy
should return true
or false
, etc.
Upvotes: 0
Reputation: 18550
There are plenty of reasons
They all emit warnings to give more information try showing these notices / log extra information on why it failed.
Upvotes: 1