Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59747 invoked from network); 14 Mar 2014 10:31:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2014 10:31:26 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.171 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.171 mail-lb0-f171.google.com Received: from [209.85.217.171] ([209.85.217.171:43568] helo=mail-lb0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AD/34-47923-C7AD2235 for ; Fri, 14 Mar 2014 05:31:25 -0500 Received: by mail-lb0-f171.google.com with SMTP id w7so1606325lbi.2 for ; Fri, 14 Mar 2014 03:31:22 -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=5qyKET84LATzAJYc442a3EkwgQPuA0jBDj3WCLBRuHw=; b=ZScS7k5DxQoE4WqTIsNQq6LQ3kpuFhwz83BKZqf3aTpZjfKy4rANSR8eooVJhWJEvU cVANojYeCkDc2M90sZVaHuViCqz2bsudgTWdcdjz366NX8nZZjcO9IBKc+sv0O2f0nCM tdPzynd87JgG1JWIJSf+JrgWvz90fAqVmTq1LKxXs0SEc1Q0c/KvyIW+o5tKtaM0t24Y XiDz4TtRk+cyg9gXuW/kNsO0hdcrSTBdZZB0IealXZow8+2nRMyUuA0jHUbXfY5QQunW ihgfan2JMJMf0xKwQ8s/PCHU+UTdCXMtWtvVop4hOGtGCr9nQyL0bK2bItLPhaXZVE17 mHug== X-Received: by 10.153.8.135 with SMTP id dk7mr5019521lad.18.1394793082300; Fri, 14 Mar 2014 03:31:22 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.205.73 with HTTP; Fri, 14 Mar 2014 03:30:42 -0700 (PDT) In-Reply-To: References: Date: Fri, 14 Mar 2014 19:30:42 +0900 X-Google-Sender-Auth: 7iNgVgpwCscKJzBQ6Tr6NhZ7v6s Message-ID: To: Andrey Andreev Cc: Pierre Joye , Patrick Schaaf , internals Content-Type: multipart/alternative; boundary=001a11347e9e34adf204f48e92f4 Subject: Re: [PHP-DEV] Re: Revert session_serializer_name(), session_gc() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11347e9e34adf204f48e92f4 Content-Type: text/plain; charset=UTF-8 Hi Andrey, On Fri, Mar 14, 2014 at 7:07 PM, Andrey Andreev wrote: > This is broken, consider the following (multiple tab/ajax/whatever > concurrency) scenario: > > Request1: session_start(['read_only' => TRUE]); > Request2: session_start(); unset($_SESSION['logged_in']); session_commit(); > Request1: still logged in > > ^ This screams "danger". > I think all of us know what it does. > > It's also, redundant ... do you really believe you'd get +1 votes for > that feature if the voters were *really* aware that this would be just > an alias for (sesson_start() && session_commit()) ? > It's not alias. It's much more efficient. > I don't think so. This is simply not what "read only" means which > makes this whole thing very misleading and if people who were supposed > to review the feature got confused by it, imagine what happens in > userland. > I might not explain well enough in the RFC, but most of use understood it's a faster version of session_start();session_commit(). Calling session_commit() right after session_start() is common optimization technique. Making it more efficient worth it. I think there is no point to write back to the session data while programmer only needs to read the data. Since session_start();session_commit(); is optimization technique, making it more efficient makes sense. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.netsession_start();session_commit() --001a11347e9e34adf204f48e92f4--