Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95054 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68885 invoked from network); 11 Aug 2016 23:21:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2016 23:21:13 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:53382] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/D1-56950-8680DA75 for ; Thu, 11 Aug 2016 19:21:13 -0400 Received: (qmail 61493 invoked by uid 89); 11 Aug 2016 23:21:08 -0000 Received: from unknown (HELO mail-qt0-f171.google.com) (yohgaki@ohgaki.net@209.85.216.171) by 0 with ESMTPA; 11 Aug 2016 23:21:08 -0000 Received: by mail-qt0-f171.google.com with SMTP id w38so5515775qtb.0 for ; Thu, 11 Aug 2016 16:21:08 -0700 (PDT) X-Gm-Message-State: AEkoousBNBg7WEO7L/PnWQuVhW6LRIWhac8wEjUm1Dha1l22KYpnzKae8tWVXEEYZJte/6G/uUZao9DWbejfgA== X-Received: by 10.200.54.243 with SMTP id b48mr14517503qtc.0.1470957662503; Thu, 11 Aug 2016 16:21:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.85.242 with HTTP; Thu, 11 Aug 2016 16:20:22 -0700 (PDT) In-Reply-To: References: Date: Fri, 12 Aug 2016 08:20:22 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Leigh Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][VOTE] Add session_create_id() function From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Leigh, On Fri, Aug 12, 2016 at 8:07 AM, Yasuo Ohgaki wrote: > $encoded = base64_encode(ini_get('session.sid_length')*2); > // Use same charset as PHP > $sid = substr(rtrim(strtr($encoded, '+/', ',-'), '='), 0, > ini_get('session.sid_length'); I've missed to handle session.hash_bits_per_character here. There are people validating SID (used chars and length) via WAF or PHP code. session.hash_bits_per_character handling is mandatory for such system. Implementing things properly and precisely is not easy :) Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net