Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73098 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13323 invoked from network); 13 Mar 2014 07:15:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2014 07:15:09 -0000 Authentication-Results: pb1.pair.com header.from=bof@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bof@bof.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: bof@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:53721] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/00-12560-AFA51235 for ; Thu, 13 Mar 2014 02:15:08 -0500 Received: (qmail 26277 invoked by uid 1009); 13 Mar 2014 08:15:03 +0100 Received: from 209.85.216.171 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/18579. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.216.171):. Processed in 0.083157 secs); 13 Mar 2014 07:15:03 -0000 X-Antivirus-MYDOMAIN-Mail-From: bof@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.216.171):. Processed in 0.083157 secs Process 26266) Received: from mail-qc0-f171.google.com (gmail@bof.de@209.85.216.171) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 13 Mar 2014 08:15:03 +0100 Received: by mail-qc0-f171.google.com with SMTP id x13so657826qcv.30 for ; Thu, 13 Mar 2014 00:15:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ROfy9GCMZi2fg6Qc5xy2svpzxO+yBwgcvuTzUwQRb0w=; b=FU8iJ5lj++b2qZnGgiJiLkPvIv7kv0fVtffH4q9fkbQr9B9u1lNNmSEKY3YMM8DMBJ Q7s0gutHcISQumPROaIezxlKiXsajU2pW9R2hYZUU1bil3xSx20ngwhXmpALkOzeIGS5 OBy6oru4FPfWYwY+4b3oi4S59bSV4IrFkxJ6+laoCS7Im5ORRo67XFNXTZUPvGI3T04Y 8Iz08PYKhoE4Ewi+0lCspuPNuSk+ik2B7BNarQgjpknEZHsW+48mqkM2W711Alj1wSaw ZEAzUMDYd+EJ9UgJeKMxzXF04MYpTY2o7GjEeGokxtoI3ere+ENqd2OJWPomMariryZh ydKQ== MIME-Version: 1.0 X-Received: by 10.140.37.47 with SMTP id q44mr244265qgq.57.1394694901210; Thu, 13 Mar 2014 00:15:01 -0700 (PDT) Received: by 10.140.41.208 with HTTP; Thu, 13 Mar 2014 00:15:00 -0700 (PDT) Received: by 10.140.41.208 with HTTP; Thu, 13 Mar 2014 00:15:00 -0700 (PDT) In-Reply-To: References: Date: Thu, 13 Mar 2014 08:15:00 +0100 Message-ID: To: Yasuo Ohgaki Cc: internals , Andrey Andreev Content-Type: multipart/alternative; boundary=001a11c120622827ef04f477b6f9 Subject: Re: [PHP-DEV] Re: Revert session_serializer_name(), session_gc() From: bof@bof.de (Patrick Schaaf) --001a11c120622827ef04f477b6f9 Content-Type: text/plain; charset=ISO-8859-1 Am 13.03.2014 02:41 schrieb "Yasuo Ohgaki" : > > Save handler may keep & check last GC time. If it's over session.expire, > perform GC. That would have a "scoping" problem: session.expire, at least in theory, can be different for different scripts / usages of session in the same application, but such a global last-GC timestamp would be... global. Also generally GC is a costly global operation, slowing down the request that hits it (probably that's why you envision a cronjob right?) > Issue is that "session data that should be deleted" is not deleted and > could be alive long term due to current design. Current design is good The _proper_ solution, would be to keep a timestamp stored with each session. kind of a last-modified timestamp. (expiry does work off last modification, right?). Anyhow, the trick is to check at session_start whether that timestamp plus whatever session.expire is set at, already is in the past - and when that happens, destroy the one session on storage and act as if it hadn't been found. This way there is no longer any correctness problem, and a GC is only needed to clean up sessions that are never requested again - and for that I fully agree that a separate - e.g. cron driven - "GC now" job would be best (not affecting latency of running frontent requests too much). Of course, going to such a solution, requires a change to all session implementations in that they must provide for storage and return of such a last-modified timestamp (or othewise the improvement cannot be realized for a non-updated-to-the-new-scheme session handler) best regards Patrick --001a11c120622827ef04f477b6f9--