Re: SessionHandlerInterface protocol
| From: | Christoph M. Becker | Date: | Wed, 23 Jun 2021 13:31:25 +0000 |
| Subject: | Re: SessionHandlerInterface protocol | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327570@lists.php.net to get a copy of this message | ||
On 23.06.2021 at 15:18, Mathieu Dubois wrote:
> Le 23/06/2021 à 14:37, Christoph M. Becker a écrit :
>
>> 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.
>
> OK, that was the only explanation that made sense. Do we agree that the
> doc could be improved by stating this more clearly ?
Yes. Consider to submit a pull request
(<https://github.com/php/doc-en/pulls>).
Christoph