Page 2 of 2

Posted: Sat Apr 08, 2006 6:38 pm
by RobertGonzalez
OK. Thanks for clearing it all up for me on session id. I don't use it much (can you tell?). I usually use DB sessions.

Posted: Tue Apr 11, 2006 1:36 pm
by spacebiscuit
Feyd,

Hi here is the results of the output of the code you gave me:

Code: Select all

PHP Version: 4.3.2-RC2
PHP OS: WINNT
Error Reporting: 2047 (E_ALL)
Register Globals: On
Short Tags: On
Display Errors: Off
Does that tell us anything?

Rob.

Posted: Tue Apr 11, 2006 2:13 pm
by spacebiscuit
Everah here are the results of your tests..........

test.php:

Code: Select all

ROB is the value set for "test".
Our current session id is 00e6b5525f41a6b04e0dbcfcea719526
Try the test
test2.php

Code: Select all

is the value set for "test".
Our current session id is 00e6b5525f41a6b04e0dbcfcea719526
Confused? Yes I am !

Rob.

Posted: Tue Apr 11, 2006 2:39 pm
by RobertGonzalez
That is odd. It seems to be keeping some session data but not other data. :?: That means sessions are working. But why they would not be working on your variables is confusing.

Is this portion of code executing after an include or other code that could potentially unset or reset the session var?

EDIT: OOhh, maybe something else you can try... On your first test page set like four or five session vars. On the second of the two test which values you have using a for each loop...

Code: Select all

<?php
foreach ($_SESSION as $key => $value) 
{
    echo $key .  ' is the session key and ' . $value . ' is its value.<br />';
}
?>
See what that throws at you.

Posted: Tue Apr 11, 2006 2:52 pm
by spacebiscuit
There are no includes, the code as it is in two simple files with no other text or lines of code.

Rob.

Posted: Tue Apr 11, 2006 3:12 pm
by RobertGonzalez
OK, run the test that I added to my last post. If that does nothing post the full code of both pages. Also, try running a stripped down version ofthe two pages for testing, making sure to write them fresh (not reusing any code from the two current pages). And try clearing your cache again to make sure you are seeing the freshest page renders.

Posted: Tue Apr 11, 2006 3:52 pm
by spacebiscuit
Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Here is my code exactly as it is in the files, the 2nd page displays nothing just a white screen......

1:

Code: Select all

<?php
session_start();
$_SESSION['test1']="ROB";
$_SESSION['test2']="ROB";
$_SESSION['test3']="ROB";
$_SESSION['test4']="ROB";
$_SESSION['test5']="ROB";
$_SESSION['test6']="ROB";
echo $_SESSION['test1'] . ' is the value set for "test1".<br />';
echo $_SESSION['test2'] . ' is the value set for "test2".<br />';
echo $_SESSION['test3'] . ' is the value set for "test3".<br />';
echo $_SESSION['test4'] . ' is the value set for "test4".<br />';
echo $_SESSION['test5'] . ' is the value set for "test5".<br />';
echo $_SESSION['test6'] . ' is the value set for "test6".<br />';
echo 'Our current session id is ' . session_id() . '<br />';
echo '<a href="test2.php">Try the test</a>';
?>

2:

Code: Select all

<?php
session_start();
foreach ($_SESSION as $key => $value) 
{
    echo $key .  ' is the session key and ' . $value . ' is its value.<br />';
}
?>

Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Apr 11, 2006 4:37 pm
by RobertGonzalez
Change the second page to this:

Code: Select all

<?php
ini_set('error_reporting', E_ALL);
session_start();
foreach ($_SESSION as $key => $value)
{
    echo $key .  ' is the session key and ' . $value . ' is its value.<br />';
}
?>
Then clear the cache and run the second page again by way of a link from the first page. See what that does.

Posted: Tue Apr 11, 2006 8:19 pm
by spacebiscuit
Hi,

I posted the 2nd script exactly as you said and I still get a blank white screen........

You can test and view the source here:

http://www.first4glass.net/test1.php

This is very odd!

Rob.

Posted: Tue Apr 11, 2006 9:17 pm
by feyd
Since display errors is off, you should check your error logs.

Posted: Wed Apr 12, 2006 4:02 am
by spacebiscuit
Ok maybe we are getting some where now........

Here is the error log:

Code: Select all

[Wed Apr 12 08:46:44 2006] [error] PHP Warning:  session_start(): open(/tmp\sess_d509fff503b0bca31d6d115b91e81725, O_RDWR) failed: No such file or directory (2) in d:\software\apache\htdocs\first4glass\test1.php on line 2
[Wed Apr 12 08:46:44 2006] [error] PHP Warning:  Unknown(): open(/tmp\sess_d509fff503b0bca31d6d115b91e81725, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
[Wed Apr 12 08:46:44 2006] [error] PHP Warning:  Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
Rob.

Posted: Wed Apr 12, 2006 4:14 am
by timvw
So the first thing you do is type the message in a search-engine (or this forum) and you get plenty of solutions..

(/tmp doesn't exist on windows so change the session.save_path to c:/temp or whatever...)

Posted: Wed Apr 12, 2006 7:59 am
by spacebiscuit
Fantastic guys, thanks for your help.

I guess I have learnt to check my error logs,just had to change the dir of the temp folder, working perfectly now.

Many thanks again!

Rob.