Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73213 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96178 invoked from network); 17 Mar 2014 11:00:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2014 11:00:38 -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.160.169 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.160.169 mail-yk0-f169.google.com Received: from [209.85.160.169] ([209.85.160.169:39211] helo=mail-yk0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/92-17561-4D5D6235 for ; Mon, 17 Mar 2014 06:00:37 -0500 Received: by mail-yk0-f169.google.com with SMTP id 142so14514719ykq.0 for ; Mon, 17 Mar 2014 04:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=VIpBhcyQkYjoKEwLdW+WROIhjqvNDxp2xVx/AIGgUF8=; b=WZTOKR0g/vKr4Yg6YJwlhsJ8qUKUAgOyP5FiwwA+lAlhGdeX/ZJHdDFKB8qH/5uybT P8LmYljbtFLMsKQXZlBXWbyXvsz91VSg+ql9V6i9OCUyQnqquJUaTb0CRQt7Q4ZJlYEo zwdwo3Qc/w0pPYV2da3e0SxdE+3OoVLfFFfEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=VIpBhcyQkYjoKEwLdW+WROIhjqvNDxp2xVx/AIGgUF8=; b=Dgaw9lagWMtFs2M8C2tASziZe4CMlV6Zx/RMd54+xLImXgJ70jU6m2hvUAYAt1wWzo LkdwQiGLXkQ7l06U/O26IdCFfeGfZS7HndcqgELZs3wkvfOE8CKTamYY8QdcTmg8F7tC hKqpG05K+bnjbmU4+5fg2E0WxeLJmATY1vQVVVaHpa+D7mGdxNM6wM4EyRfIy4caifam +gQ/zEBH5rXxzrfLMLLoMixIOWs2/shFEaO2VfI3bh0/DT4iDHR8N+lEnzJe2eQuJpQt RWYDwLQ64LogaH6uHOVwtIISEPkudHK9Aeul/q5+UzeYRlvV88TCt2OMBT6z0XpxbB7l SHtg== X-Gm-Message-State: ALoCoQlSkHENd/XZsYnwPLtjdq2/PFYrqoH3LK5EnaMv9mGKyTbtYzX4c9FRo0iGGlmh8BzViFg9 MIME-Version: 1.0 X-Received: by 10.236.160.9 with SMTP id t9mr9087708yhk.10.1395054034128; Mon, 17 Mar 2014 04:00:34 -0700 (PDT) Received: by 10.170.188.139 with HTTP; Mon, 17 Mar 2014 04:00:34 -0700 (PDT) Date: Mon, 17 Mar 2014 13:00:34 +0200 Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Solution for session_regenerate_id() issues From: narf@devilix.net (Andrey Andreev) Hi, I don't think delaying deletion is a good idea, it just brings more complexity to the whole process and I can't really imagine how it would be handled, since PHP is not run as a daemon - this is the reason why the session GC is triggered by chance instead of running as some type of a cron job. Applications usually handle this by not regenerating session ID during an ajax request. Most JS frameworks would send a 'X-Requested-With: XMLHttpRequest' header to provide a way for Ajax detection, and PHP frameworks have helper methods to look for that header. Even if they don't - anybody can implement a similar solution for their own application. With that said, I'd rather give a +1 for changing the session_regenerate_id() default action from "don't delete" to "delete", like you've previously suggested. Btw, I wouldn't worry about stolen session IDs ... if somebody steals it once, they'll do it after regeneration as well. Session ID regeneration is only effective against brute-force attacks. Cheers, Andrey.