php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21031 No Session Files created - No variables transfered from 1 page to another
Submitted: 2002-12-15 16:30 UTC Modified: 2002-12-15 21:53 UTC
From: JeanFrederic at Loiseau dot org Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.3 OS: Windows XP
Private report: No CVE-ID: None
 [2002-12-15 16:30 UTC] JeanFrederic at Loiseau dot org
Hi there,

I've tried to make Sessions work with Php 4.2.3 and Apache 1.3.24 on Windows XP.

NO WAY

1st try :
---------

session_start();
if (!isset($_SESSION['compteur'])) {
    $_SESSION['compteur']=0;
}else {
    $_SESSION['compteur']++;
}
echo $_SESSION['compteur'];

-> after severals 'refresh', compteur stay at 0 !

2nd try :
---------

session_start();
if (isset($HTTP_SESSION_VARS['compteur'])) {
   $HTTP_SESSION_VARS['compteur']++;
}
else {
   $HTTP_SESSION_VARS['compteur'] = 0;
}
echo $HTTP_SESSION_VARS['compteur'];

-> after severals 'refresh', compteur stay at 0 !

3rd try :
---------

if (!session_is_registered('compteur')) {
    session_register("compteur");
    $compteur = 0;
}
else {
    $compteur++;
}
echo $compteur;

-> after severals 'refresh', compteur stay at 0 !

4th try :
---------

if (!session_is_registered('compteur')) {
    session_register("compteur");
    $compteur = 0;
}
else {
    $compteur++;
}
echo $compteur."<br>";
echo "<A HREF=\"test.php?SID\">click here</A>.";

-> after severals 'refresh', compteur stay at 0 ! BUT SessionID is correctly transfered page after page...

---------- CONCLUSION -----------

No way to make it works... even with basic samples, what the way I choose.

WHAT IS STRANGE : no Session files written in /tmp as it should be !

Hereafter my Phpinfo() for session :
------------------------------------

Session Support enabled 

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

Any idea on this bug ???

Regards,

Jean-Frederic

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-15 17:40 UTC] JeanFrederic at Loiseau dot org
I've found that under Windows XP, if the session.save_path is '/tmp' even if this directory exist... it will not work... is it a bug ?

But never mind, I put c:\windows\temp and it works

The problem now is close to bug #20170

here is the code

session_start();

if (!isset($_SESSION['maVariable'])) {
    $_SESSION['maVariable']=0;
}else{
    $_SESSION['maVariable']++;
}
echo $_SESSION['maVariable'];

Very simple no ? :-) But this is NOT working on my configuration (Php 4.2.3 + Apache 1.3.24 + Windows XP) unless I add

echo "<A HREF=\"test.php?SID\">click here</A>.";

So no way to get the variables values transfered if I do not give to next page the Session ID...

Why ???????????? Is it a bug ?

Hereafter my php.ini config :

session.auto_start = Off 
session.cache_expire = 180
session.cache_limiter = nocache
session.cookie_domain = no value
session.cookie_lifetime = 0
session.cookie_path = c:\windows\temp
session.cookie_secure = Off 
session.entropy_file = no value
session.entropy_length = 0 
session.gc_maxlifetime = 1440
session.gc_probability = 1 
session.name = PHPSESSID
session.referer_check = no value
session.save_handler = files
session.save_path = c:\windows\temp
session.serialize_handler = php
session.use_cookies = On
session.use_trans_sid = 0

So I change session.cookie_path to session.cookie_path=/ 
and IT WORKS !!!!!

So is it a bug ?????

why /tmp which is an existing directory do not work for session.save_path ?

why c:\windows\temp which is an existing directory WORKS for session.save_path BUT NOT for session.cookie_path ?????

I just want to know if it's a bug or not... if not, I'm sorry for this message, but I'm sure it will help some of you who could fall in the trap...

Jean-Frederic (happy now after hours lost to search a workaround ;-))
 [2002-12-15 20:26 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-12-15 21:53 UTC] msopacua@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

First farmiliarize yourself, with the term "cookiepath". This is not a local path, but the webserver path.

http://wp.netscape.com/newsref/std/cookie_spec.html
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 11:01:28 2024 UTC