note 99286 added to function.session-start

From: Date: Sun, 08 Aug 2010 23:48:02 +0000
Subject: note 99286 added to function.session-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-171474@lists.php.net to get a copy of this message
I recently stumbled upon a problem in my download script where a download link would be clicked but then no other links would work until that download had finished. Other instances/windows would not work either. This is because session_start() locks the session data until the script finishes. In my case, until the script had finished sending the file data (which in a throttling script can take a while). The solution is to use session_write_close(); This writes the current session data back to the session and closes the session so that other instances/windows can access the script using the same session. Since adding it to my script my site can now have several files downloading at once from the same session and still serve pages. ---- Server IP: 87.124.126.127 Probable Submitter: 87.115.81.245 (proxied: 87.115.81.245) ---- Manual Page -- http://www.php.net/manual/en/function.session-start.php Edit -- https://master.php.net/note/edit/99286 Del: integrated -- https://master.php.net/note/delete/99286/integrated Del: useless -- https://master.php.net/note/delete/99286/useless Del: bad code -- https://master.php.net/note/delete/99286/bad+code Del: spam -- https://master.php.net/note/delete/99286/spam Del: non-english -- https://master.php.net/note/delete/99286/non-english Del: in docs -- https://master.php.net/note/delete/99286/in+docs Del: other reasons-- https://master.php.net/note/delete/99286 Reject -- https://master.php.net/note/reject/99286 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#171474) next »