Re: [PHP] Link to .php page with session

[email protected] (santel)
Newsgroups php.general
Message-ID <[email protected]>
Stuart wrote:

>2009/6/16 santel <[email protected]>:
>  
>
>>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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.