php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5370 Session won't pass any variables in this platform.
Submitted: 2000-07-05 02:39 UTC Modified: 2003-05-16 03:31 UTC
Votes:7
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:3 (50.0%)
From: eggli at giga dot net dot tw Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.1pl2 OS: Windows 98
Private report: No CVE-ID: None
 [2000-07-05 02:39 UTC] eggli at giga dot net dot tw
A simple prog like this:
index.php:
{
$foo = "test";
session_register("foo");
printf('<a href="script.php?%s">Link</a>', SID);
}

script.php:
{
session_start();
echo $foo;
}

This prog works perfect in Unix-like system, but won't work under Windows 98, I've heard it won't work under any win32 system, too.

Here's my .ini:
[Session]
session.save_handler      = files   
session.save_path         = g:\php\php\tmp\    
session.use_cookies       = 0       session.name              = PHPSESSID  
session.auto_start        = 0       session.cookie_lifetime   = 180
session.cookie_path       = \
session.cookie_domain     =         session.serialize_handler = php     
session.gc_probability    = 1
session.gc_maxlifetime    = 1440   
session.referer_check     =        session.entropy_length    = 0    
session.entropy_file      =    1  
session.entropy_length    = 16
session.entropy_file      = /dev/urandom
session.cache_limiter     = nocache
session.cache_expire      = 180  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-05 10:49 UTC] stas at cvs dot php dot net
In what way it doesn't work? Error messages, what's in session files?
 [2000-07-05 13:13 UTC] eggli at giga dot net dot tw
No error messages.
It shows nothing.

The session file cotains like this:
!foo|

Well, if u put some echos b4 or after the 'echo $foo',
even a break line after it, it shows nothing..like this:
B4 line

After line

BTW, the server platform is Windows 98 SE 4.10.2222.A, PWS 4.0.

More php.ini
register_globals = On
track_vars = On
 [2000-07-05 13:15 UTC] stas at cvs dot php dot net
Please supply reproducing code.
 [2000-07-05 13:16 UTC] stas at cvs dot php dot net
Does it happen on other win32 platforms too?
 [2000-07-05 13:20 UTC] stas at cvs dot php dot net
Also, what happens if you set enable_cookies to ON? 
And try also: 
                           printf('<a href="script.php?%s">Link</a>', session_id());

 [2000-08-01 22:43 UTC] waldschrott@php.net
no feedback, closed
 [2002-01-12 03:46 UTC] fbo at qwest dot net
I get these 3 warnings on Windows 98 4.10.2222A, Apache 1.3.14, PHP 4.0.3pl1:

Warning: open(\tmp\sess_906cf0440e666cf0f87ea4bbee139c97, O_RDWR) failed: m (2) in c:\program files\Apache Group\Apache\htdocs/session2.php on line 2

Warning: open(\tmp\sess_906cf0440e666cf0f87ea4bbee139c97, O_RDWR) failed: m (2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (\tmp) in Unknown on line 0

The following solved the problem:

Make sure you are editing the php.ini file found in the Php\ directory, not in the windows\ directory.

Set the session.save_path to an absolute path, relative paths (like /tmp) don't work.

For example:

session.save_path = C:\Program Files\Apache Group\Apache\htdocs\tmp

I used this prog for testing:

<?php
session_start();
session_register("your_name");
if(!empty($your_name))
{
	echo "I already know your name, $your_name";
}
elseif(empty($your_name)&&!isset($submit))
{
	echo "<form name=myform method=post action=$PHP_SELF>
		<input type=text name=first_name> first name<br>
		<input type=text name=last_name> last name<br>
		<input type=submit name=submit value=submit>
		</form>";
}
elseif(isset($submit)&&empty($your_name))
{
	$your_name=$first_name . " " . $last_name;
	echo "Thank you, $your_name";
}
?>
 [2002-01-12 04:25 UTC] fbo at qwest dot net
Don't use the testing program I posted, I forgot it was tied to a database.
 [2002-01-12 20:57 UTC] yohgaki@php.net
What kind of FAT file system are you using?
(i.e. Does the file system support modified time?)

I believe you are using newer PHP, don't you? Please update Version field.

PS: Change status to "Open" if you reopen bug report :)
 [2002-01-14 15:12 UTC] fbo at qwest dot net
FAT 32 bit
modified time?
Where is the registration form on this site?
 [2002-02-01 10:09 UTC] t dot zander at brain-at-work dot de
I'm getting this error msg:

Warning: open(/tmp\sess_021e6dafeb513b539d491681bfc95c73, O_RDWR) failed: No such file or directory (2) in c:\programme\apache group\apache\htdocs\voba_wangen\inc.frontend.funcs.php on line 468

on our linux machine it works great. only win98 sucks :(

i tried to set an absolute path like fbo@qwest.net said, but it didn't help :(
 [2002-02-02 06:40 UTC] sander@php.net
No feedback was provided for this bug, so it is being suspended.
If you are able to provide the information that was requested,
please do so and change the status of the bug back to "Open".
 [2002-07-19 02:37 UTC] mdelmonico at prodigy dot net
I?ve reconfigured the .ini files in both the Windows directory and PHP directory as suggested and changed my session.save_path =c:\program files\Apache group\Apache\htdocs\tmp. Unfortunately, the problem still existed. My operating system is ME and use Apache 1.3.19 and PHP 4.0. Below are the error messages and the corresponding codes that generated the error messages.  

Warning: open(/tmp\sess_898f989ebde72088d6c8f780496496a0, O_RDWR) failed: m (2) in c:\program files\apache group\apache\htdocs\index.php on line 4


Warning: open(/tmp\sess_898f989ebde72088d6c8f780496496a0, O_RDWR) failed: m (2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

<?
  include ('book_sc_fns.php');
  // The shopping cart needs sessions, so start one
  session_start();
  do_html_header("Welcome to Book-O-Rama");

  echo "<p>Please choose a category:</p>";

  // get categories out of database
  $cat_array = get_categories();

  // display as links to cat pages
  display_categories($cat_array);
 
  // if logged in as admin, show add, delete, edit cat links
  if(session_is_registered("admin_user"))
  {
    display_button("admin.php", "admin-menu", "Admin Menu");
  }

  do_html_footer();
?>
 [2003-05-16 03:31 UTC] magnus@php.net
Closing this one now... 
 
Should work just fine with latest release. 
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 05:01:27 2019 UTC