move all DB session storage logic to SessionHandler where it belongs
This commit is contained in:
parent
5ab1d509d2
commit
202035fc68
@ -77,10 +77,7 @@ class Session {
|
|||||||
session_regenerate_id(false);
|
session_regenerate_id(false);
|
||||||
|
|
||||||
if(self::$handler) {
|
if(self::$handler) {
|
||||||
$v = q("UPDATE session SET sid = '%s' WHERE sid = '%s'",
|
self::$handler->rename($old_sid,session_id());
|
||||||
dbesc(session_id()),
|
|
||||||
dbesc($old_sid)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
logger('no session handler');
|
logger('no session handler');
|
||||||
|
@ -80,4 +80,13 @@ class SessionHandler implements \SessionHandlerInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// not part of the official interface, used when regenerating the session id
|
||||||
|
|
||||||
|
function rename($old,$new) {
|
||||||
|
$v = q("UPDATE session SET sid = '%s' WHERE sid = '%s'",
|
||||||
|
dbesc($new),
|
||||||
|
dbesc($old)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user