Re: [Q] Session provider & returning FAILURE from PS_OPEN_FUNC?
| From: | Chris Wright | Date: | Wed, 24 Jun 2015 13:57:09 +0000 |
| Subject: | Re: [Q] Session provider & returning FAILURE from PS_OPEN_FUNC? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86846@lists.php.net to get a copy of this message | ||
On 23 June 2015 at 23:09, Eric Stenson <ericsten@microsoft.com> wrote:
> Quick behavioral question:
>
> If an extension is implementing a Session handler, and returns FAILURE
> from its PS_OPEN_FUNC(), will the extension receive subsequent
> PS_READ_FUNC()/PS_WRITE_FUNC() calls?
>
> Also, if an extension returns FAILURE from its PS_OPEN_FUNC(), will the
> extension receive a PS_CLOSE_FUNC()/PS_DESTROY_FUNC() call?
>
No to all, if you return FAILURE then it results in an E_ERROR before the
point where the session state is marked as active, i.e. it's fatal, so no
further calls to anything will be made.
http://lxr.php.net/xref/PHP_TRUNK/ext/session/session.c#488
I'd argue that this shouldn't be fatal, but that's another topic for
another thread.
>
> If there are any docs on writing a Session handler, please let me know!
> I'm happy to RTFM...
>
Not officially as far as I am aware but someone else may know different.
There may be some unofficial resources on the net if your Google-fu is good
enough, a cursory search didn't turn anything up for me.
>
> Thx!
> --E.
>