php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16412 Using session_start() repeatedly (on different pages) causes HTTP 500
Submitted: 2002-04-03 12:04 UTC Modified: 2002-07-13 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: rob at garfoot dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.1.2 OS: Windows XP
Private report: No CVE-ID: None
 [2002-04-03 12:04 UTC] rob at garfoot dot com
I've had this with a more complex script but here is a cut down version.

When I call session_start() in my script then link to another page that calls session_start() I eventually get HTTP 500 internal server error. This usually happens after 3 or 4 links. Its fine for the first few links usually.

I'm running on the version of IIS that comes with XP Pro. 
I changed none of the php.ini setting during installation apart from the session var directory which is now f:\data\websites\sessions.

The version of PHP is the binary of v4.1.2 for windows downloaded from php.net. I'm running as CGI.

Here is an example of the code that exhibits the problem. If I keep clicking the "Click me" link it throws the error after 3-4 clicks most of the time.

<?
session_start();
?>

<html><body>
<a href="<?=$_ENV['SCRIPT_NAME']?>">Click me</a>
</body></html>

Rob

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-04 10:29 UTC] rob at garfoot dot com
Ok this is wierd but I've noticed that once I started getting the HTTP 500 errors I couldnt get even a simple script eg <? echo "Test"; ?> to work.

I tried checking the "Check that file exists" on the application extension mapping in IIS and it all seems to work now. Odd.
 [2002-06-07 10:57 UTC] k.schroeder@php.net
Please try to recover your bug with PHP 4.2.1.
 [2002-07-13 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-07-07 12:03 UTC] tamagog02000 at yahoo dot com
hi my problem is when using session_start() i get this warning Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\xampp\htdocs\Copy of finalproject\signin.php:2) in C:\Program Files\xampp\htdocs\Copy of finalproject\signin.php on line 4

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\Copy of finalproject\signin.php:2) in C:\Program Files\xampp\htdocs\Copy of finalproject\signin.php on line 4
1 
 inspite that am using ob_start() before session_start()what should i do?
 [2007-09-21 22:55 UTC] ghdg at tfuyd dot jhog
http://www.meta-fx.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 03 13:01:26 2024 UTC