Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73428 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46459 invoked from network); 25 Mar 2014 16:06:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2014 16:06:33 -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.213.50 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.213.50 mail-yh0-f50.google.com Received: from [209.85.213.50] ([209.85.213.50:34714] helo=mail-yh0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/E2-29088-889A1335 for ; Tue, 25 Mar 2014 11:06:33 -0500 Received: by mail-yh0-f50.google.com with SMTP id c41so688358yho.23 for ; Tue, 25 Mar 2014 09:06:29 -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:content-type; bh=yRPQnx4ZKgAulZQ07EXL7rr8FsN8olYhC5jzM6oW1O8=; b=KJqmTVMkdb5hHClFbXgIwdzDQOjQpDgegC61DBIh50Ge+BHJa9aHRWeo7Zj47OM09p qX3BeQQnvV/y+bMw6FU72iOh+Utdvxv3clgsc6C2FANP48j6r/UkhrxFt8oCjyCE0vNy N4EQBlB0HyfNRBiGlQfp2iR/S739/VUIozK/I= 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:content-type; bh=yRPQnx4ZKgAulZQ07EXL7rr8FsN8olYhC5jzM6oW1O8=; b=mLh8L4y6YhMisGQ0kRcz3nmKFIuWl9GP+YKlPpelzBP4feDH+ytI0yzCDh0ZNJJLG1 iaTFyCj+hyuMSaY5gkIzyQXFi/84EJq+CaB02W2maqjX/MSI0KsMHsfPagrsJzsMv9SY VzvmrpAMfPvcJBysfDbRWNY8StbJFANLbGq9pVqjG+fXtQ8yD/moAU6g6Lstwi5ixP+m 6/BuzGo2Zvq7yH3HgcWOzqIlkG3Ev3JWMj3NGWzwjKYxa1zR6w+9AJwnFFkS7HhPMYxR D5EZ9WbSzJMyhl1Vz73smzY1gngBayXZ7GEvnEoCcZS19KXPfCYK8RHo2+iYZaKkDs47 azbA== X-Gm-Message-State: ALoCoQkHFc7a8PPklUTEerVBqang+OInNmcgAOJhfCuAecoB/jXhfRu56PyBoeXRAinG1R1LjCVs MIME-Version: 1.0 X-Received: by 10.236.125.12 with SMTP id y12mr75395224yhh.42.1395763589313; Tue, 25 Mar 2014 09:06:29 -0700 (PDT) Received: by 10.170.188.139 with HTTP; Tue, 25 Mar 2014 09:06:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Mar 2014 18:06:29 +0200 Message-ID: To: Julien Pauli Cc: Yasuo Ohgaki , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: session_reset() and session_abort() to send errors From: narf@devilix.net (Andrey Andreev) Hi, I had previously requested the removal of these 2 functions based on lack of discussion about them (or at least I found none). My request was ignored because I had to tell "why it's not needed", which I don't think is the right approach for a new feature that somebody just decided to commit, but regardless ... here's a good reason: From what I understand, session_reset() not only discards changes to $_SESSION and not just re-reads the data, but re-initializes the whole session. This includes calls to open(), read(), which include opening file pointers, setting locks, checking session ID validity, etc. I don't know how safe that is to do internally, but with a userland session handler, it means discarding previously open connections/file pointers, locks and whoever knows what else a developer might've cached, assuming that open(), read() would only be called once. It would've also been better IMO if the function was called session_restart() instead, because of the above-described behavior. I also don't like that these 2 functions kind of make sessions to look like a traditional database transaction, or at least I'd hate it to see code that uses them for the wrong purpose, but that's rather philosophical ... I do see them as useful for resetting the application to a certain state in case of an error, but in that context - session_abort() alone should be sufficient. Cheers, Andrey.