NoorAdiga Posted December 11, 2008 Share Posted December 11, 2008 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 More sharing options...
Brian W Posted December 11, 2008 Share Posted December 11, 2008 you have to declare the session on every page that uses it. not sure what you are doing, but this is what I have on pages I need to use sessions session_start(); http://us.php.net/session_start Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-712817 Share on other sites More sharing options...
NoorAdiga Posted December 11, 2008 Author Share Posted December 11, 2008 Ya of course I make session_start() and the same script run correctly in my first windows so I think the problem is sth related to the settings ... the syntax is 100% correct ! Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-712842 Share on other sites More sharing options...
gevans Posted December 11, 2008 Share Posted December 11, 2008 post some code Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-712846 Share on other sites More sharing options...
Brian W Posted December 11, 2008 Share Posted December 11, 2008 maybe I'm confused as to what you mean by window. Is the new page being opened in a different directory? post some code agree, lets see what you got going Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-712848 Share on other sites More sharing options...
NoorAdiga Posted December 11, 2008 Author Share Posted December 11, 2008 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 More sharing options...
NoorAdiga Posted December 11, 2008 Author Share Posted December 11, 2008 :'( nobody knows anything that might help Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-712989 Share on other sites More sharing options...
mrMarcus Posted December 12, 2008 Share Posted December 12, 2008 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. Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-713239 Share on other sites More sharing options...
gevans Posted December 12, 2008 Share Posted December 12, 2008 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 Link to comment https://forums.phpfreaks.com/topic/136559-session-problem/#findComment-713242 Share on other sites More sharing options...
NoorAdiga Posted December 12, 2008 Author Share Posted December 12, 2008 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 More sharing options...
NoorAdiga Posted December 12, 2008 Author Share Posted December 12, 2008 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 More sharing options...
gevans Posted December 12, 2008 Share Posted December 12, 2008 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 More sharing options...
NoorAdiga Posted December 12, 2008 Author Share Posted December 12, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.