
Lee Eden - 2015-05-04 19:47:25
It's also useful to know that you can use session_start() and session_write_close() multiple times within a script. So you can, for example, get values to use at the start of the script and then change them later without locking the session in between by doing something like:
session_start();
$loggedUser=$_SESSION['user'];
$orderID=$_SESSION['orderID'];
$orderStatus=$_SESSION['orderStatus'];
session_write_close();
sleep(5); // do a load of stuff
session_start();
$_SESSION['orderStatus']='calculated';
session_write_close();