Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95103 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85341 invoked from network); 12 Aug 2016 19:50:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2016 19:50:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=bishop.bettini@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bishop.bettini@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.50 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:34583] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/83-55605-2782EA75 for ; Fri, 12 Aug 2016 15:50:11 -0400 Received: by mail-oi0-f50.google.com with SMTP id l203so47725999oib.1 for ; Fri, 12 Aug 2016 12:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aDaYTzExp4/klwBPzfGsX7bjA9LAvHKEc1oBAk6i6Jw=; b=yat4LxfyQL6gSz3rGH/MQduyQpstv+69Czm3d1AkLI2s2TKqR0FuL9Loc6vsOxwKk9 EzjgEZZKQpIW1i6S7RyUAKT6p7S7j27X/OnwIrsl+0Rc00QGge4Agv9JkNBEB2S4GSy1 JOkNqE3FOs5+pWcdN2FtR21p4oN5GCSCeJ3061wlhUrtyQtb4Fob4hdU6l/aLcoH3XrK G3b9oIM6tk887h5WZc/exnFJ3mQahIhXYlw/fBQuc3CpFGTbSBCQ+bAw+3VBOMAZhCFJ qaR2i/8T22lLBwaoD3m86g5z5kHt2SHv6/VLO8TGDDxwN1lZc28eeeampelnIlJMQN+M U/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:sender:in-reply-to :references:from:date:message-id:subject:to:cc; bh=aDaYTzExp4/klwBPzfGsX7bjA9LAvHKEc1oBAk6i6Jw=; b=C3Nc5hRi8iQWLEDoK2bl0fZsepFhPx7QtQpZhMj9AnKVIMF+oUtpGppt2X5d4/UvhU 4vmDzkr1CMxbb6kbDR0gmvTHXe52GqLV2SBOk33UQ5jlDKdFaBkySGX0BExeMqfn8BBD 9Kzw6ZDORf8O4fo68hiF/TlPj7n3KusbkGxIYf5v0rcrIehGLVQ/xR5arUzqUm7z1lpn jdP7svCdXfUV6Q9UOZKMsxHP+38cgFptwrvnr436RCJ0UE6bboYxW44RbasUHa8AyYZe jJ679g6NZVA9yve1BmXJfEsd2TxV8zbTzMXx7iJ5gLPVjGh6+LnzZJ+cGHGYGSGU7wAM yQQw== X-Gm-Message-State: AEkoouup+sh/tjooH8Xgh0b1TYNgP68q2ddsrzkil/9gXefGISN/2VpVf28UJZjhw9JTaoYsCGlNLVB0smJ4KA== X-Received: by 10.202.234.86 with SMTP id i83mr9168238oih.177.1471031408077; Fri, 12 Aug 2016 12:50:08 -0700 (PDT) MIME-Version: 1.0 Reply-To: bishop@php.net Sender: bishop.bettini@gmail.com Received: by 10.157.11.214 with HTTP; Fri, 12 Aug 2016 12:49:37 -0700 (PDT) In-Reply-To: References: Date: Fri, 12 Aug 2016 15:49:37 -0400 X-Google-Sender-Auth: NmsXV-NawQYKs-Nry5h1NMcRomg Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113d522e883d570539e530c8 Subject: Re: [PHP-DEV] [RFC][VOTE] Add session_gc() function From: bishop@php.net (Bishop Bettini) --001a113d522e883d570539e530c8 Content-Type: text/plain; charset=UTF-8 On Wed, Aug 10, 2016 at 5:30 AM, Yasuo Ohgaki wrote: > Hi all, > > This RFC is to add session_gc() function. > > session_gc() function is required API for periodic session GC that is > best practice for production web sites. > > https://wiki.php.net/rfc/session-gc > It requires 2/3 majority to pass. > Vote starts: 2016/08/10 - Vote ends: 2016/08/17 23:59:59 UTC > +1. Should we document a polyfill, since the session GC firing logic can be non-intuitive? Here's an attempt, anyhow: function session_gc() { $initial = [ session_status(), ini_get('session.gc_probability'), ini_get('session.gc_divisor'), ]; if (PHP_SESSION_DISABLED === $initial[0]) { return false; } if (PHP_SESSION_ACTIVE === $initial[0]) { session_write_close(); } ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 1); session_start(); ini_set('session.gc_probability', $initial[1]); ini_set('session.gc_divisor', $initial[2]); if (PHP_SESSION_NONE === $initial[0]) { session_write_close(); } return true; } --001a113d522e883d570539e530c8--