Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70133 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62905 invoked from network); 14 Nov 2013 21:25:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2013 21:25:25 -0000 Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.219.44 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.219.44 mail-oa0-f44.google.com Received: from [209.85.219.44] ([209.85.219.44:41397] helo=mail-oa0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/12-53459-4CF35825 for ; Thu, 14 Nov 2013 16:25:24 -0500 Received: by mail-oa0-f44.google.com with SMTP id l6so2953525oag.31 for ; Thu, 14 Nov 2013 13:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamharvey.name; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=rnJz8SRDDZCLnDU6FFjJGJXlWrkimz85my33f19WXHA=; b=BrIIis2hLzWC98+KQQlbB6iBhe2RORDnSpQFUljNkeIIMeoFcRliUa9AOJeJqIb7oV CDm0Fnfn+ZgBOM7uQ7dljETMfkR3wl1WlofJrTcDcWpYx4lkwqwMW0Uj/tghcju8madD 7IseZMzLS6DiArGot5FC/J6N07EQDjOKaE/MQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=rnJz8SRDDZCLnDU6FFjJGJXlWrkimz85my33f19WXHA=; b=YESYfTTIOZ4YDtZXFlRXEo/dBQzzHdzaayrW3DTEfyrj+tCPfOGDJGt5YknCN8Kg0I Fgp43vjevugSO0hzizKMQyWcVgjCOPjJu/fwcrtwSvPcYxYjDx7WKJIUA8y/HD20H0Zf Dh5hAzQ6NUEr8JbHgnDHYd1SqVKfQG3AtXnumdWXN8d+lsIE2Nm+58e1NAGyCk/eBWVg Glcg5LU3UKas0YpxKAN+z6VZxeaAJYJ2kV/prr9/TkvxXO+7yWbDL/isc3RIdS2RqMs+ veX58wshtbhTlZihWgM+YfBav+CvW+7tWHlNX/5JEYdsw1JvItWUsyCjG4wwhkrCmD0b 4zxQ== X-Gm-Message-State: ALoCoQnuwnLMCQfDJ8CtLuADxUi2CFZiLZUFatbMM5aD9NKUTdDSvU4DgXA1g9Nq7ogs27jrKvEP X-Received: by 10.182.40.201 with SMTP id z9mr3578086obk.45.1384464320262; Thu, 14 Nov 2013 13:25:20 -0800 (PST) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.76.178.161 with HTTP; Thu, 14 Nov 2013 13:25:00 -0800 (PST) In-Reply-To: <52853E69.5040104@sugarcrm.com> References: <5285390D.6000106@sugarcrm.com> <52853E69.5040104@sugarcrm.com> Date: Thu, 14 Nov 2013 13:25:00 -0800 X-Google-Sender-Auth: vI9w6_NamlqYkSQbOHSMcw-DLW8 Message-ID: To: Stas Malyshev Cc: Yasuo Ohgaki , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Session cache, lock and write From: aharvey@php.net (Adam Harvey) On 14 November 2013 13:19, Stas Malyshev wrote: >> I think you've wrote this before I sent new mail. For files save handler= , >> when session.lock=3DOff, it will be >> >> open-and-lock -> read session data -> close-and-unlock -> >> script executed >> -> open-and-lock -> write session data -> close-and-unlock > > I don't think this is a very good idea, since what happens if somebody > else changed the state while script was executing? That change would be > killed by the write. The lock is not for writing, the lock is for data > consistency between reading in writing. If you gave up the lock, you > should not write afterwards because your data may be stale. I can see situations where that might be useful =E2=80=94 where it's not so important if the write gets clobbered so long as there's minimal locking to ensure that the session file is at least valid. I'm still on the fence about whether it's actually a useful thing to support in php-src, though. It might be enough of a corner case to not make it worth supporting in a bundled session handler, and I'm worried the people might start giving advice that using it will "speed up your application" and users who copy-paste configurations will silently usedata. As an aside, if we do implement it: Yasuo, you've convinced me that session.lock is a reasonable name (instead of being handler-specific). :) Adam