Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73442 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1025 invoked from network); 26 Mar 2014 09:58:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Mar 2014 09:58:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.171 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.171 mail-vc0-f171.google.com Received: from [209.85.220.171] ([209.85.220.171:56785] helo=mail-vc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/10-33864-2D4A2335 for ; Wed, 26 Mar 2014 04:58:43 -0500 Received: by mail-vc0-f171.google.com with SMTP id lg15so2109392vcb.30 for ; Wed, 26 Mar 2014 02:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=231dvTGg1aNKA09FhTesiICWU8Pq+L3ViuZHVv6pZhY=; b=iyQM4mNHe4KJJ+fD60Q9U+t5T3dbx51y1tjEzgtmZXDrvxjR2mPCLQ7yK4nT62qYk2 ybgjW4l/Oko+gBH0u/w89etLiuN0d9ZKi9SqlMuSdfR4u4QcEzeWWhTvSF7YwR5v949g 7RsX3gaHM1TxkeKHKQjMwpqmdJEJYQknqC1nouxNEHSgqglOlhr7mePR8l/dako1nRBI /qrYfvJXDImYpJSC9t+yfuwu2a5Dbqnx2889CiNCjjA/8+Qr6bGGiiPKQkwd4Xl+VE8V oI6Pw71Ossc6dKxwAKC5PB4BePf5TePoowTKFnX6TShOvYVl4gjSLMdBCa39B4SY5qQ/ nOkg== X-Received: by 10.220.12.66 with SMTP id w2mr14341857vcw.15.1395827918244; Wed, 26 Mar 2014 02:58:38 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.81.68 with HTTP; Wed, 26 Mar 2014 02:57:58 -0700 (PDT) In-Reply-To: References: Date: Wed, 26 Mar 2014 10:57:58 +0100 X-Google-Sender-Auth: y6jf2KH2bAS4fJZmJm0oJxbcuAM Message-ID: To: Andrey Andreev Cc: Yasuo Ohgaki , PHP Internals Content-Type: multipart/alternative; boundary=001a11c315003c109c04f57f839d Subject: Re: session_reset() and session_abort() to send errors From: jpauli@php.net (Julien Pauli) --001a11c315003c109c04f57f839d Content-Type: text/plain; charset=ISO-8859-1 On Tue, Mar 25, 2014 at 5:06 PM, Andrey Andreev wrote: > Hi, > > I had previously requested the removal of these 2 functions based on > lack of discussion about them (or at least I found none). My request > was ignored because I had to tell "why it's not needed", which I don't > think is the right approach for a new feature that somebody just > decided to commit, but regardless ... here's a good reason: > > 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. > > I also don't like that these 2 functions kind of make sessions to look > like a traditional database transaction, or at least I'd hate it to > see code that uses them for the wrong purpose, but that's rather > philosophical ... I do see them as useful for resetting the > application to a certain state in case of an error, but in that > context - session_abort() alone should be sufficient. > Yup, I agree that I dont really see a use case for session_reset(). The implementation looks strange. Yasuo, could you clarify please ? Julien --001a11c315003c109c04f57f839d--