I found that the updateTimestamp has special function.
Seems this was specifically meant for updating timestamp for Cookie based session.
When we use Cookie as a mode of storage of session data we need to maintain the timestamp inside the cookie data.
Generally, when we use other modes we have timestamp details for when it was last accessed. I. case of Cookie this details is with browser as the modified data is set at that moment but not inside the cookie.
So, if we need the last accessed timestamp we can add a kay for the timestamp.
The hack is we need to use session option ['serialize_handler' => 'php_serialize'] so that unserialize add required timestamp key and re serialize it.
I think the 'php_serialize' is the only option which helps to decode the sessionData inside the Session Handler class.
PHP.mk документација
SessionUpdateTimestampHandlerInterface
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
class.sessionupdatetimestamphandlerinterface.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + преведен приказ
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
class.sessionupdatetimestamphandlerinterface.php
SessionUpdateTimestampHandlerInterface
Референца за `class.sessionupdatetimestamphandlerinterface.php` со подобрена типографија и навигација.
Интерфејсот SessionUpdateTimestampHandlerInterface
Интерфејсот SessionUpdateTimestampHandlerInterface
Вовед
SessionUpdateTimestampHandlerInterface (PHP 7, PHP 8) session_set_save_handler() е интерфејс кој дефинира опционални методи за креирање на прилагоден ракувач на сесии. За да се проследи прилагоден ракувач на сесии до OOP користејќи го неговиот
повик, класата може да го имплементира овој интерфејс.
Синопсис на класата
interface SessionUpdateTimestampHandlerInterface {
/* Методи */
}Содржина
- SessionUpdateTimestampHandlerInterface::updateTimestamp — Креирај ID на сесијата
- SessionUpdateTimestampHandlerInterface::validateId — Ажурирај го временскиот печат
Белешки од корисници 2 забелешки
guy dot sartorelli на silverstripe точка com ¶
1 месец пред
Анонимен ¶
пред 6 години
There is a bit of documentation provided by Wu Xiancheng. See his comment in the SessionHandlerInterface section:
https://www.php.net/manual/en/class.sessionhandlerinterface.php#122032