Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92130 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18397 invoked from network); 7 Apr 2016 15:12:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2016 15:12:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.47 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.47 mail-oi0-f47.google.com Received: from [209.85.218.47] ([209.85.218.47:36726] helo=mail-oi0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/AE-48788-FD876075 for ; Thu, 07 Apr 2016 11:12:31 -0400 Received: by mail-oi0-f47.google.com with SMTP id y204so102502347oie.3 for ; Thu, 07 Apr 2016 08:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=OsiiQ1DjXR/LzQbrNatesgTFU5p36S5kd+h4ZqO1CfQ=; b=nQSwY6hJSNFmLdd5mwcAJFevP5tuNbYA51iU9gyVoOHa6IDk/3on53HagHgpoGF8Wq CdJfHCM5fDlxdKoog0OCOxta5hm0CSSAudDj2QcJYJm4VWPNao5OZfeKeoTCqk3wT4Rp EwpUBHlP+Wh51Nowki/gB51ZkMkefAWv8VW24= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=OsiiQ1DjXR/LzQbrNatesgTFU5p36S5kd+h4ZqO1CfQ=; b=AnmgNBlR1z8x5GU0eWHbeKuEoPVe6U1EWjM919oW+AOneL+ZMlg6UZZamXRLLj/swD FzRj257OALHxbZVqA3bVHYKykz88S5qTIuerGEAdUeBV51F76kWMkEK4Kwnmlbu47qVp 7c//gN4nppqI9OFH6kjRzEf3Hn0aNrL1KrSP0926wgi1s/C14VhQSxuYNW1WG2Cwod3b F3Ob46x5iGHA89wvVoHsWzxJrCpU8g8z0ILKq+4AcWBl2zoHqbUGrjQ5wxYmarTcoSz0 nXYKoiFgdQzJ/y2CMRk7yJRVjteE/G/Qth0Q1qQNe/pbLz9ASrF1DR4xfi194moC5YQR co4w== X-Gm-Message-State: AD7BkJJvl3ezfUkdneE5tHNyrd9Bk6+/v6W0EtQq2jtOAuUbi2SkdY8nr6nLIkxoblL4+Fq/Bzus3skRNf8ZRw== MIME-Version: 1.0 X-Received: by 10.157.2.40 with SMTP id 37mr1814537otb.191.1460041948696; Thu, 07 Apr 2016 08:12:28 -0700 (PDT) Received: by 10.202.175.87 with HTTP; Thu, 7 Apr 2016 08:12:28 -0700 (PDT) In-Reply-To: References: Date: Thu, 7 Apr 2016 18:12:28 +0300 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=94eb2c11549cb5ad75052fe681cc Subject: Re: [PHP-DEV] [RFC][Discussion] Add session_gc() From: narf@devilix.net (Andrey Andreev) --94eb2c11549cb5ad75052fe681cc Content-Type: text/plain; charset=UTF-8 Hi, 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. 2. What happens if SessionHandler::gc() was triggered by the probability mechanism, but you then call session_gc() manually? 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. 3. If session_gc() bypasses the gc_probability, gc_divisor INI settings*, then why does it still rely on gc_maxlifetime? 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. Cheers, Andrey. --94eb2c11549cb5ad75052fe681cc--