Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52392 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75891 invoked from network); 16 May 2011 13:51:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 13:51:04 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-ew0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:52421] helo=mail-ew0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/97-26716-6CB21DD4 for ; Mon, 16 May 2011 09:51:03 -0400 Received: by ewy2 with SMTP id 2so1313563ewy.29 for ; Mon, 16 May 2011 06:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=GuiI/WM9XbOCH5gFopmwNs7Ragz4I0bH4Fro/HwjUUs=; b=Mt/TFAHIxQnW2OCmcJw63D1KtkQQJqQZzERUvXrqp+0UwtUouFSVU3qwx31G1DEwl2 exR1bczkjWL+08KivIzHc0FymIOHDrJncZLadgtkl2/g0mVoN/Wafr1B6atRRbVxbM4G IhU5bp7bp1goDm7q5xs62qcpB+EAWK+X9EL64= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=BaBXo9/u28Njw/q2bGdl4iMjUO6Nz+FQa0UK0fmvCC5H3oA1zW29M/DrOqSC+4b/Ce 5h2kKXnW2KvLb2FllHgvGkqiNx9PmkQ0he0uro9NLyaieCYJm8RwsQQ6uYrA+Lq0mw2c qtkmoBTLecbDh2WzxZOIk6Ucs02/dyN+rNyi8= MIME-Version: 1.0 Received: by 10.14.17.70 with SMTP id i46mr1551268eei.116.1305553858458; Mon, 16 May 2011 06:50:58 -0700 (PDT) Sender: tyra3l@gmail.com Received: by 10.14.37.13 with HTTP; Mon, 16 May 2011 06:50:58 -0700 (PDT) In-Reply-To: <4DD12989.7090602@thelounge.net> References: <20110516133753.GA24346@phcomp.co.uk> <4DD12989.7090602@thelounge.net> Date: Mon, 16 May 2011 15:50:58 +0200 X-Google-Sender-Auth: TOEricEZQng7yL4CNu-7C55B88w Message-ID: To: Reindl Harald Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e65b52f8f7f53f04a364f1ba Subject: Re: [PHP-DEV] session_disconnect() From: info@tyrael.hu (Ferenc Kovacs) --0016e65b52f8f7f53f04a364f1ba Content-Type: text/plain; charset=UTF-8 On Mon, May 16, 2011 at 3:41 PM, Reindl Harald wrote: > There is no function needed if you use > http://php.net/manual/de/function.session-write-close.php > like others do since ten years :-) > > if you know that you no longer write to the session use it > this does not mean $_SESSION is lost > it means only that changes to $_SESSIOn are not available for other > requests > > Am 16.05.2011 15:37, schrieb Alain Williams: > > I am working on some AJAX callbacks. These need to open the session, get > hold of stuff in $_SESSION > > and that is it ... they won't be changing the session data. The trouble > is that because the > > session file is locked the Asynchronicity of AJAX is reduced a bit, > especially if some of the > > server side calls need a lot of work. > > > > May I suggest: > > > > session_disconnect(); > > > > This would, in effect, close the session file but leave $_SESSION. This > would be easy to implement, > > just call the second callback to session_set_save_handler(). > > > > This is NOT quite the same as a session_end() function since that would > presumably write the > > (changed) contents of $_SESSION back to where ever. With > session_disconnect() any changes made > > to $_SESSION would be lost regardless of them being made before or after > the call to session_disconnect(). > > > > Another way of doing this would be to add an optional boolean argument to > session_start() which > > would load $_SESSION and then disconnect. This is more intrusive in that > changes to any user > > open functions (of session_set_save_handler()) would be needed. It might > be a tiny bit faster > > or neater. > > > > > > I do not know how much of a speed improvement this would make to what > sort of AJAX applications. > > on a related note, could we fix http://bugs.php.net/bug.php?id=38104 ? with that in mind, somebody could close and reopen the session as necessary(with releasing and acquiring the lock properly). personally I always went with the lock the whole session until the request is complate, used the session_write_close to release the lock on the session before the request ended, but never needed to re-open it after I closed. but I can see why is the current behaviour is a PITA. Tyrael --0016e65b52f8f7f53f04a364f1ba--