Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92424 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59789 invoked from network); 18 Apr 2016 18:55:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2016 18:55:47 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.46 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.46 mail-pa0-f46.google.com Received: from [209.85.220.46] ([209.85.220.46:36508] helo=mail-pa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/BC-11975-2BD25175 for ; Mon, 18 Apr 2016 14:55:47 -0400 Received: by mail-pa0-f46.google.com with SMTP id er2so53019115pad.3 for ; Mon, 18 Apr 2016 11:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=CmjodxRADvCf0W2QEOgL/6W4n4vgtQyF/p5Xy7VxDrY=; b=TOD8jy6SFZ/j5xtdEGb9SSSDBMOckEvC2I4VVNMpZb2vhBtbzxGZo3nMtGvZoJfuP7 I4WBUojX6crzKhWNN5lybbopfKVyOL+1mFuK1U5sSxPEeI9YGxeuWtYFtzXNr1yom1GP nlyizfDGIhHBWOktOmK42pcJ8CnWuGZTAxdmXKVIrSAuF+oZnJIgCVhNmQ2M9gkZMjXt YmLHOnHjRaYSmeivFdWEddYBg71mQdmv87LfV8BY/ytkvtMCOWAAua6O9E/2NaCFzeer BPHOKrVabwThFywNhvWTO/nJsEXAv39SV1OhaPwVZH/qdYTBMavCITHpAQBZWt/nVsmf pRNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=CmjodxRADvCf0W2QEOgL/6W4n4vgtQyF/p5Xy7VxDrY=; b=FULZhLXREFIOPesnzHtvwoW1Y2ituHHwoxqWLOOK83Jum7HnQWbc8ULYVrpTxoDinX h26YrFJRCbnzm2vWG8xmHBAZma2YemheyxALDJur/Sko35X8MV88CcxY12XTyC6sVtIs 3THYjtCwi/QAsuiZXxqD4R71HW8togIBbTadYuCXH/VciXajiIjbr9+UUYNLTGJP8lgS 9xTj9xf5AthQizELoCD6L92cZtMctgBUMsRsmvRcBjYACxQ+rm7T96H46fUz7Y+THyji 06jXKpf9VwIwTFdeKGIXn5jH/u0JuNDmtFaxTGQfl/JZWq5BN/rUdwJ0G9zbbg6L1Scw gqIw== X-Gm-Message-State: AOPr4FWg8tjrBxl4vdHQk8Qsuxv6dl3XLKCx4hAGELezqzqrREgex3HnxcnPVbN/e1zyJA== X-Received: by 10.66.1.99 with SMTP id 3mr24560720pal.26.1461005743984; Mon, 18 Apr 2016 11:55:43 -0700 (PDT) Received: from Stas-Air.local (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id 67sm23495499pfy.22.2016.04.18.11.55.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2016 11:55:42 -0700 (PDT) To: Andrey Andreev , Yasuo Ohgaki References: <570D2F74.7060702@gmail.com> Cc: "internals@lists.php.net" Message-ID: <57152DAD.6000002@gmail.com> Date: Mon, 18 Apr 2016 11:55:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Discussion] Add session_gc() From: smalyshev@gmail.com (Stanislav Malyshev) Hi! >> Document calling session_gc() periodically is the best practice. > > If you want to document usage of this new API as the best practice, it > would be unfair to the users if you don't also document the caveats that > come with it: I also think it's wrong to document it so. While having periodical GC is the best practice, probabilistic GC *is* calling GC periodically. True, for some exceptional scenarios - like sites with very low traffic - the period is unpredictable. And *then* it's recommended to explicitly call session_gc(), and for these cases it is a great addition. But in a typical medium or high traffic site the period is very predictable as as such there's no way to document otherwise. > probability-based behavior (and how to do that; based on my > observations, the vast majority of users don't know how GC is triggered > at all) And that's great BTW since majority of users don't need to know that - it just works. We shouldn't ruin that. > - Trigger warnings when session_gc() is called while gc_probability is > not 0. This does not sound like a good idea to me. Why we should make it harder for people to use it together? session_gc() has nothing to do with gc_probability. > - To avoid re-activating expired sessions, trigger warnings when > session_gc() is called after session_start() Last time I've looked at the patch, session_gc() was required to be called after session start. See: https://github.com/php/php-src/pull/1852/files#diff-2e4264d70a35458a2241e27f76f4a93cR20 I think this is wrong (see my comments there) and in fact we should not expose this complexity to the user - gc() should just do the GC and hide the technical details. -- Stas Malyshev smalyshev@gmail.com