Re: SessionHandlerInterface protocol
| From: | Christoph M. Becker | Date: | Wed, 23 Jun 2021 12:37:07 +0000 |
| Subject: | Re: SessionHandlerInterface protocol | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327568@lists.php.net to get a copy of this message | ||
On 23.06.2021 at 13:41, Mathieu Dubois wrote:
> Le 23/06/2021 à 12:01, Christoph M. Becker a écrit :
>
>> Before ::read() is called, open() is called. ::open() is suppossed to
>> create the empty session data, if no data for the given session exist.
>> This empty data string should then be returned from ::read(). If
>> ::read() fails to read the data, it should return false (or actually any
>> non-string value in the current implementation) to signal failure.
>
> I might be confused but the session id is not passed to ::open() so how
> is it supposed to create the empty session data ? By using session_id ?
Ah, right, ::open() is not supposed to create the empty session data.
This can be done in ::read(); the built-in "files" handler does this,
for instance; if the file does not exist and can't be created, ::read()
fails.
Christoph