Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92154 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82078 invoked from network); 8 Apr 2016 03:47:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Apr 2016 03:47:32 -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.213.68 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.213.68 mail-vk0-f68.google.com Received: from [209.85.213.68] ([209.85.213.68:34914] helo=mail-vk0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/49-48788-3D927075 for ; Thu, 07 Apr 2016 23:47:31 -0400 Received: by mail-vk0-f68.google.com with SMTP id e185so14654983vkb.2 for ; Thu, 07 Apr 2016 20:47:31 -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; bh=eBKz6DuN7uAdHGGit6GUXtJWjhRcOKCA/kx3bU3CuVA=; b=sMeDPRg3HYQJRr8ip5L24ZDC0hYzKg42OyAu1SbcsJsSSR8Qer1Ik0VPs9gTyWxzur mUPe1lZ36uBiGHKdRwKvYERvXBF6/qTtadJjP6OtDVU7s7K/pFT5LizIr0YBYTxwk6KX y1Ly3uzyf/VpnL8bY2inewjjzAkeU5QXnLbCGfEZIDv58ftlLGhbGgMBWcsQ7U0J+YTC UMAFLHPQcyl6Y+hEw+7r1S7o09L11C1sH/EIpusLNe/JEaDy7W5XfrxXOQcPMcySL7nW NHg5K3JrWcXMGuud+1VnuFNJ2C00abkLNS+2dHDA9LNDcNdBNAzEzs4kRCU8+zQYGJ1h P8mQ== 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; bh=eBKz6DuN7uAdHGGit6GUXtJWjhRcOKCA/kx3bU3CuVA=; b=ApSS3A0gteUPETnupSJGVJOM8V57fHjqcF0jQBwfIo8ze15QUh6RYaEY7NRxZu+YKT 0IBxu9Qv7/+ZE8gjwFQz4GFkoeOENErF3CtC4LuYCxvZlnvan2FunkBtg4UwPpsQyVcc 7/cBZahIu9kF7nIa1A0N10mT+X7zN2OpfDz7UkIYmKnlkNIe0O3l+tzY63Sgfd9VMMQb TWbSJ4oYfgsdeki/ti4Y0Y00ZBU5DUkbT7cMBkJGHgMlvf3hqIKdfPuNeQKTxNR++t9C Ogixg0FltY/ddEZvZkRGpz6UzzIsMNfGIDhKx5eRF37apngssrdvDgi4kMsBLNY4nxMg B45Q== X-Gm-Message-State: AD7BkJKsTK49InVSQU7GmmcjMIevgO4xlvsdva8fZv9QqSOQUas19t/eCS9z17nWCr3ZrAvp8ZUMp4/HdqLTMw== X-Received: by 10.31.34.2 with SMTP id i2mr3164568vki.7.1460087248365; Thu, 07 Apr 2016 20:47:28 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.159.40.7 with HTTP; Thu, 7 Apr 2016 20:46:48 -0700 (PDT) In-Reply-To: References: Date: Fri, 8 Apr 2016 12:46:48 +0900 X-Google-Sender-Auth: yCWzypLPgCOZthSjCqjFxkDM-mo Message-ID: To: Andrey Andreev Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][Discussion] Add session_gc() From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Andrey, On Fri, Apr 8, 2016 at 12:12 AM, Andrey Andreev wrote: > On Thu, Apr 7, 2016 at 9:05 AM, Yasuo Ohgaki wrote: >> >> Hi all, >> >> This is very old RFC that adds session_gc(). >> https://wiki.php.net/rfc/session-gc >> >> It simply adds missing session_gc() function. >> Comments are appreciated. >> > > There are a few question marks raised by the RFC's (lack of) content ... > > 1. How exactly does the function work? > > I can see that in the patch, but it should be explained in the RFC too .. > even the function signature is missing. Added > > 2. What happens if SessionHandler::gc() was triggered by the probability > mechanism, but you then call session_gc() manually? It should perform GC w/o condition > > It seems odd that you've put "Document calling session_gc() periodically is > the best practice" in the RFC itself, but are not addressing this issue. > IMO, it is more important to document this and here's an idea: trigger at > least an E_NOTICE in that case. > > Speaking of the documentation part - it's not hard to imagine A LOT of > people doing this: > > session_start(); > session_gc(); > > That's not a small problem. Shooting their own foot is not our problem, but leaving obsolete and possibly active session is ours. > > 3. If session_gc() bypasses the gc_probability, gc_divisor INI settings*, > then why does it still rely on gc_maxlifetime? It's a mistake. I spend too little time for this. This will be fixed. > > The signature for SessionHandlerInterface::gc() accepts a TTL value as a > parameter; session_gc() can too: > > function session_gc($ttl = ini_get('session.gc_maxlifetime')) {} > > * Note: The current patch doesn't actually ignore gc_probability, but I > think that's by mistake (also relevant to my previous point). I'll comment > on the PR on GitHub. Good point. Since session module does the job if module should execute GC or not. It should be 1 or very short time. These are addressed soon. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net