Re: session_reset() and session_abort() to send errors

From: Date: Tue, 01 Apr 2014 00:59:48 +0000
Subject: Re: session_reset() and session_abort() to send errors
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-73495@lists.php.net to get a copy of this message
Hi Andrey, On Fri, Mar 28, 2014 at 6:41 PM, Andrey Andreev <narf@devilix.net> wrote: > On Fri, Mar 28, 2014 at 8:54 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > > Hi Andrey, > > > > On Wed, Mar 26, 2014 at 1:06 AM, Andrey Andreev <narf@devilix.net> > wrote: > >> > >> From what I understand, session_reset() not only discards changes to > >> $_SESSION and not just re-reads the data, but re-initializes the whole > >> session. This includes calls to open(), read(), which include opening > >> file pointers, setting locks, checking session ID validity, etc. I > >> don't know how safe that is to do internally, but with a userland > >> session handler, it means discarding previously open connections/file > >> pointers, locks and whoever knows what else a developer might've > >> cached, assuming that open(), read() would only be called once. > >> It would've also been better IMO if the function was called > >> session_restart() instead, because of the above-described behavior. > > > > > > It's safe. Don't worry. > > As always, I prefer better names. > > Well, I just re-checked it and does indeed just call > php_session_initialize(), so what's the point? Shorthand for > session_abort() && session_start() ? Yes, it's an API for it. It's more efficient than user land functions as it requires needless close and open (and initialization required to open). Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#73495) next »