Re: Link to .php page with session

From: Date: Wed, 17 Jun 2009 07:56:29 +0000
Subject: Re: Link to .php page with session
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-294146@lists.php.net to get a copy of this message
Stuart wrote:
2009/6/16 santel <santel@siscom.it>:
Hi, I have a .php page that use sessions and shows a file .FLV by transcoding, on the fly, from any format video to FLV using a shell command [ system("/usr/bin/ffmpeg -re -i ./file.wmv -f flv -an -sameq -") ]. In a .php page: case 1): if j put a link to any page without session, all is ok; case 2): if j put a link to .php page with session -->
      when j click the link, the link take place only after
      system() command execution end.
Is there a way to obtain case 1) behaviour also in case 2) ?
I may have interpreted your problem incorrectly, but I think your problem is due to the session data not being saved until the script has finished running, including the system call. To get around this you can save and close the session before calling system using the session_write_close [1] function. Note that after calling that you won't be able to make any other changes to the session data in that request. -Stuart [1] http://php.net/session_write_close
Hi Stuart, You are right, session_write_close solved the problem. Thank you very much Sante Luciani

« previous php.general (#294146) next »