PHP 4.0 Bug #7877 Updated: session_register produces error
| From: | sniper@php.net | Date: | Sun, 19 Nov 2000 03:35:14 +0000 |
| Subject: | PHP 4.0 Bug #7877 Updated: session_register produces error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38489@lists.php.net to get a copy of this message | ||
ID: 7877
Updated by: sniper
Reported By: jrv@canada.com
Status: Closed
Bug Type: *Session related
Assigned To:
Comments:
This is no bug. You should move the session_register() block to the
very beginning of the script. i.e. Before ANY output is done in the script.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-11-18 21:39:59] jrv@canada.com
I get the following output:
Warning: Cannot send session cookie - headers already sent by (output started at
/home/helpdesk/count.php:8) in
/home/helpdesk/count.php on line 10
Warning: Cannot send session cache limiter - headers already sent by (output started at
/home/helpdesk/count.php:8) in
/home/helpdesk/count.php on line 10
Hello visitor, you have seen this page 1 times.
To continue, click here
From the script:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="IBM WebSphere Homepage Builder V4.0.0 for
Linux">
<TITLE></TITLE>
</HEAD>
<BODY bgcolor="#ffffff">
<?php
//session_save_path("/tmp");
session_register ("count");
$count++;
?>
Hello visitor, you have seen this page <?php echo $count; ?> times.<p>
To continue, <A HREF="nextpage.php?<?=SID?>">click here</A>
</BODY>
</HTML>
Config info from phpinfo();
'./configure' '--target=i386-redhat-linux' '--prefix=/usr'
'--with-config-file-path=/etc'
'--disable-debug' '--enable-pic'
'--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs'
'--disable-static'
'--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext'
'--with-gd'
'--with-jpeg-dir=/usr' '--with-png'
'--with-zlib' '--with-db2' '--with-db3' '--with-gdbm'
'--enable-debugger'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sysvsem'
'--enable-sysvshm' '--enable-track-vars'
'--enable-yp' '--enable-ftp' '--without-mysql' '--with-xml'
session.auto_start
Off
Off
session.cache_expire
180
180
session.cache_limiter
nocache
nocache
session.cookie_domain
no value
no
value
session.cookie_lifetime
0
0
session.cookie_path
/
/
session.entropy_file
no value
no
value
session.entropy_length
0
0
session.gc_maxlifetime
1440
1440
session.gc_probability
1
1
session.name
PHPSESSID
PHPSESSID
session.referer_check
no value
no
value
session.save_handler
files
files
session.save_path
/tmp
/tmp
session.serialize_handler
php
php
session.use_cookies
On
On
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7877