Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52390 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73245 invoked from network); 16 May 2011 13:41:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 13:41:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=h.reindl@thelounge.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=h.reindl@thelounge.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thelounge.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: h.reindl@thelounge.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Windows 98 (1) Received: from [91.118.73.15] ([91.118.73.15:51713] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/37-26716-C8921DD4 for ; Mon, 16 May 2011 09:41:34 -0400 Received: from [10.0.0.99] (rh.thelounge.net [10.0.0.99]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.thelounge.net (Postfix) with ESMTPSA id 9354FBE for ; Mon, 16 May 2011 15:41:29 +0200 (CEST) Message-ID: <4DD12989.7090602@thelounge.net> Date: Mon, 16 May 2011 15:41:29 +0200 Organization: the lounge interactive design User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: internals@lists.php.net References: <20110516133753.GA24346@phcomp.co.uk> In-Reply-To: <20110516133753.GA24346@phcomp.co.uk> X-Enigmail-Version: 1.1.2 OpenPGP: id=7F780279; url=http://arrakis.thelounge.net/gpg/h.reindl_thelounge.net.pub.txt Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF1BE640425B47047CD50B5E7" Subject: Re: [PHP-DEV] session_disconnect() From: h.reindl@thelounge.net (Reindl Harald) --------------enigF1BE640425B47047CD50B5E7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 reque= sts Am 16.05.2011 15:37, schrieb Alain Williams: > I am working on some AJAX callbacks. These need to open the session, ge= t 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, esp= ecially if some of the > server side calls need a lot of work. >=20 > May I suggest: >=20 > session_disconnect(); >=20 > 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(). >=20 > 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_discon= nect() any changes made > to $_SESSION would be lost regardless of them being made before or afte= r the call to session_disconnect(). >=20 > 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 tha= t changes to any user > open functions (of session_set_save_handler()) would be needed. It migh= t be a tiny bit faster > or neater. >=20 >=20 > I do not know how much of a speed improvement this would make to what s= ort of AJAX applications. --------------enigF1BE640425B47047CD50B5E7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk3RKYkACgkQhmBjz394AnmnigCeLfANRRo8jqxEF5Lq73TgsCF9 FHcAn2m9MfIerTBGaSRefnsZMkiLVWc0 =FGON -----END PGP SIGNATURE----- --------------enigF1BE640425B47047CD50B5E7--