php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7877 session_register produces error
Submitted: 2000-11-18 21:39 UTC Modified: 2000-11-18 22:35 UTC
From: jrv at canada dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.1pl2 OS: RedHat 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jrv at canada dot com
New email:
PHP Version: OS:

 

 [2000-11-18 21:39 UTC] jrv at canada dot 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-18 22:35 UTC] sniper@php.net
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
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 00:01:27 2025 UTC