Jump to content

Session problem


NoorAdiga

Recommended Posts

Hey folk ... hope u r all doin' good  ;)

 

my problem is about sessions in php5

I'm having 2 windows XP on drive C and D

The session work correctly on the first windows, but while trying (the same script) on the other windows I get the following detailed problem:

1. the session is created at the first page and I can echo it ... and I see it in the folder I save sessions in (I knew it bcz I empty the file before running the script and after that I got one new file with strange file)

2. when I check for that session I created from another page it says its unset and return nothing ....

 

The same script run on the first windows but not the second one hmm but I need to run it on the second windows bcz my database is there and my new project use data base

 

any suggestions ?!?

plz help  :(

Link to comment
https://forums.phpfreaks.com/topic/136559-session-problem/
Share on other sites

I 've two operating system (both are windows XP but different editions CDs)

 

I write this code in the first file

 

<?php

 

session_start();

 

 

 

$_SESSION['hi']= "Hello!";

 

echo "The session hi contain ".$_SESSION['hi'];

 

 

 

 

?>

 

and this code in the second file

 

<?php

 

session_start();

 

 

 

if (isset($_SESSION['hi']))

 

echo "set !";

 

 

 

 

 

if (!isset($_SESSION['hi']))

 

echo "not set !";

 

 

 

 

 

 

 

echo $_SESSION['hi'];

 

?>

 

 

 

first I run the first page the I open the second ....

it prints not set and null only

but the same code run on the other windows xp and printed set Hello!

 

what do u think ?

 

 

Link to comment
https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-712862
Share on other sites

perhaps your personal webserver/php configuration is setup differently within both OS's if i am understanding your situation properly.check to make sure the directory in which sessions are stored is accessible and that the path is correct.

 

I'm using firefox for both o.s but with different versions ...

so how 2 check my browser ? and what the required setting ? can u explain more  ???

 

Thank u for ur replay !

Link to comment
https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-713277
Share on other sites

Do you understand how sessions work??

 

They are independent to the browser you're working in.

 

The same session won't work in 2 different browsers (at the same time) let alone different operating systems

 

yes sure, I'm running the same script on one o.s and browser at at time, not together ... and this make sense , bcz both of 'em on the same pc

 

thanks for ur replay  :)

Link to comment
https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-713278
Share on other sites

Do you understand how sessions work??

 

They are independent to the browser you're working in.

 

The same session won't work in 2 different browsers (at the same time) let alone different operating systems

 

yes sure, I'm running the same script on one o.s and browser at at time, not together ... and this make sense , bcz both of 'em on the same pc

 

thanks for ur replay  :)

 

I don't think you do understand.

 

With the code you have the second script will never echo a session because a you never set a session variable via that session id

Link to comment
https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-713281
Share on other sites

There is a misunderstand ...

I run the code once on the first windows with the same browser

and didn't give me the result (and that is the window I 've my db on)

and second time a completely different operating system (another windows xp) with another apache/php and it runs correctly with the session set

 

I'm not using any different browsers or o.s at the same run!

Link to comment
https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-713324
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.