NYCPHP Meetup

NYPHP.org

[nycphp-talk] simple problem with sessions

Jeff Siegel jsiegel1 at optonline.net
Sat Oct 9 18:50:30 EDT 2004


But wouldn't it be the case that the user has already been redirected to 
a different page before the script has terminated? That is, when the 
code is:

header('Location: otherpage.php');
exit;

Jeff

Chris Shiflett wrote:

> --- Jeff Siegel  wrote:
> 
>>Take a look at the second note at:
>>http://php.net/session_write_close
> 
> 
> I've seen this suggested before (using session_write_close()), and I've
> never understood it. It's possible that I'm just missing something, but
> the header() function never terminates the script, and PHP always writes
> session data once the script ends.
> 
> Has anyone ever actually seen the user of header() result in the session
> data not being written? I'd be very interested in knowing whether there is
> some fringe case or bug that prompted this suggestion. I used to do this
> myself, until I actually thought about it for a minute and couldn't figure
> out why it made any sense. :-)
> 
> Chris
> 
> =====
> Chris Shiflett - http://shiflett.org/
> 
> PHP Security - O'Reilly     HTTP Developer's Handbook - Sams
> Coming December 2004        http://httphandbook.org/
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
> 



More information about the talk mailing list