php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17186 session works only after reload on apache2, trans-sid didnt work
Submitted: 2002-05-13 13:31 UTC Modified: 2002-09-19 12:48 UTC
From: joerg@php.net Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.0 OS: IRIX64 6.5.15m
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joerg@php.net
New email:
PHP Version: OS:

 

 [2002-05-13 13:31 UTC] joerg@php.net
Testing the 4.2.1RC2 as a 64bit CGI with apache2 shows a strange behavior with a simple session script.

Based on a example from the manual the following script only works after the page was reload.

<?php
//ini_set('session.use_cookies',0);
session_start();
if (!isset($_SESSION['count'])) {
    $_SESSION['count'] = 0;
} else {
    $_SESSION['count']++;
}
?>
<html>
<head><title>session test</title></head>
<body>
<?php
echo 'count = '.$_SESSION['count'].'<br />';
echo '<a href='.$_SERVER['PHP_SELF'].'>link</a><br />';
?>
</body>
</html>

Nothing was shown during the first visit but client asking about for accepting the cookie, so after a reload page would work as aspectet. If the script sets 'session.use_cookies' to 0 the page wont works any more(no output). Same is happend when the same setup was made in the php.ini.

Using the cgi via comandline the following output was given back..

Settings: 'session.use_cookies = 1' 
[o200]:/usr/local/apache/htdocs/php/sessions $  ../../../cgi-bin/php index.php
X-Powered-By: PHP/4.2.1RC2
Set-Cookie: SID=8cdd40e358f292da280d84fbba73b6e3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

And now with the -q parameter
[o200]:/usr/local/apache/htdocs/php/sessions $  ../../../cgi-bin/php -q index.php
<br />
<b>Warning</b>:  Cannot send session cookie - headers already sent in <b>/usr/local/httpd64/htdocs/php/sessions/index.php</b> on line <b>3</b><br />
[o200]:/usr/local/apache/htdocs/php/sessions $
 
and now with
Settings: 'session.use_cookies = 0'
the output looks similar to the first without the Set-Cookie information.

Error_reporting is set to E_ALL and error.log is stil activate but shows nothing.


when using the -q parameter no output was shown ?!
../../../cgi-bin/php -q index.php

There is a testscript temporaray available under
http://194.15.95.23:8080/php/sessions/index.php
http://194.15.95.23:8080/php/sessions/index.phps //source
http://194.15.95.23:8080/php/sessions/info.php // phpinfo()

The same script runs fine with apache 1.3.24 + mod_php and cgi on
http://194.15.95.23/php/sessions/index.php

[o200]:/usr/local/apache/htdocs/php/sessions $ ../../../cgi-bin/php -m
Running PHP 4.2.1RC2
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies

[PHP Modules]
xslt
xml
wddx
tokenizer
sysvshm
sysvsem
standard
shmop
session
posix
pcre
mysql
ftp
exif
dio
dbx
dbase
ctype
calendar
bcmath

[Zend Modules]

file ../../../cgi-bin/php
../../../cgi-bin/php:   ELF 64-bit MSB mips-4




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-19 12:48 UTC] kalowsky@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 19:01:32 2024 UTC