php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3844 sessions not being recognized
Submitted: 2000-03-16 03:14 UTC Modified: 2000-04-01 23:23 UTC
From: ajprice at uiuc dot edu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Beta 4 Patch Level 1 OS: linux 2.2.12-20
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ajprice at uiuc dot edu
New email:
PHP Version: OS:

 

 [2000-03-16 03:14 UTC] ajprice at uiuc dot edu
I am using phpb4pl1 as a statically compiled module with apache 1.3.12.  I configured php as follows: 
CFLAGS="-O2 -DEAPI" \
./configure \
--disable-debug \
--with-mysql \
--with-unixODBC=/usr/local/unixODBC

The problem I am having is that the following script is not running as expected on my machine.  However, I know that this scripts runs correctly on a win98 box with phpb4 (or perhaps phpb4pl1, i'm not sure, it's not my box).

*********
<?

session_start();
if(!$m){
  echo "<br>registering m";
  $m="first time";
  session_register('m');  //only gets called the first time the page is loaded
}

echo '
        <html><head><title>test</title></head><body>
        <form action="me.php" method="post">
        new m: <input type="text" name="new_m"><br>
        set m: <input type="radio" name="set_m"><br>
        <input type="submit" value="submit">
        </input>
        </body>
        </html>
';

if($set_m){
  $m=$new_m;
  echo "<br>m: $m";
}else{
  echo "<br>m: $m";
}

?>

************
On my machine, everytime I click submit or reload the page, a new session is created instead of using the session created the first time the page is loaded.

The session related options from my php.ini file are as follows:

session.save_handler      = files
session.save_path         = /tmp
session.use_cookies       = 1
session.name              = PHPSESSID
session.auto_start        = 0
session.cookie_lifetime   = 0
session.cookie_path       = /
session.cookie_domain     =
session.serialize_handler = php
session.gc_probability    = 1
session.gc_maxlifetime    = 1440
session.referer_check     = 1
session.entropy_length    = 0
session.entropy_file      =
session.cache_limiter     = nocache
session.cache_expire      = 180

Thanks in advance.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-16 10:34 UTC] joey at cvs dot php dot net
Is the browser getting a cookie?
 [2000-03-16 17:11 UTC] ajprice at uiuc dot edu
I'm not sure.  There is no file for it in c:\windows\cookies when I load the page with IE5.01 .  However, there is an option in the security settings for IE5.01 that says "Allow per-session cookies (not stored)", so I don't think I should expect to see the session cookies.  I'm not sure.
 [2000-03-16 17:23 UTC] ajprice at uiuc dot edu
I'm not sure.  There is no file for it in c:\windows\cookies when I load the page with IE5.01 .  However, there is an option in the security settings for IE5.01 that says "Allow per-session cookies (not stored)", so I don't think I should expect to see the session cookies.  I'm not sure.
 [2000-03-17 02:05 UTC] joey at cvs dot php dot net
Turn on cookie notification in your browser,
see if cookie is being sent.
 [2000-03-17 03:55 UTC] ajprice at uiuc dot edu
I did as you suggested.  Here is what I found.  Using IE5.01 with "prompt for cookies" turned on, when I load the page for the first time, a cookie is set with the following properties (after clicking the "more info" button on the window that appeared):
Name: PHPSESSID
Domain: (my server)
Path: /
Expires: End of session
Secure: no
Data: 6f601a4118c9035ab72085e6e89a64a6

When I submit the form, with and without the radio button clicked and/or text in the textbox, or click reload, it doesn't ask me if I want to allow a cookie to be set, yet the behaviour of the script is not correct, and a new session file appears on my server.

When I tried with Netscape Communicator 4.5, it prompts the first time the page loads and every subsequent reload or submittal, each time with a different session id.
 [2000-04-01 23:23 UTC] sas at cvs dot php dot net
Compile with --enable-track-vars
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 07:00:01 2026 UTC