The only time I have had trouble with firefox and $_SESSION has been because it stores the value across multiple tabs (whereas IE doesn't) so I haven't seen your problem before. Can you please post your code for when you store the variable and when you try to access it again?
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
Thanks for reply,
ya sure i will tell u where i am using this.
$loginId=$_REQUEST[user];
$password=$_REQUEST[password];
$_SESSION["userId"]=$loginId;
this is working well on this page in IE and mozilla Firefox
But when i am calling this another page $_SESSION["userId"] in IE this is working well and but not in FireFox.
What is the reason. pls help me. It is very urgent.
Thanks,
Gagan
Hi gagan...
once try by using single quotes...
$loginId=$_REQUEST['user'];
$password=$_REQUEST['password'];
$_SESSION[<strong>'</strong>userId<strong>'</strong>]=$loginId;
ahmksssv
Junior Poster in Training
84 posts since Feb 2009
Reputation Points: 11
Solved Threads: 7
This problem with sessions comes again and again. I think it was last month I help solve a simular problem. In most cases the cookie required for the session is unable to be stored inside the browser. So in otherwords, are cookies disabled in the browser that disallows sessions. So if it is mozilla firefox that sessions are not working, check that cookies are enabled. Cookies are all enabled then try using the session id in the url. Those two solutions solve most cases although the session id in the url may be a bit ugly. To use the session id in a url the following is an example of doing a link:
<?
echo '<a href="page2.php?' . SID . '">page 2</a>';
?>
Hope that helps.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
gagan how did u solved your session issue?
He may take a while since earlier today he was online and might be night time in his timezone. But since I am familiar with this common problem I will ask for you to run these two test pages in the problem browser(s) to see if they work.
index.php
<? session_start();
$_SESSION['var']='test';
echo '<a href="page2.php?' . SID . '">click here to see if session are enabled.</a>';
?>
page2.php
<? session_start();
if (empty($_SESSION['var']) || !isset($_SESSION['var'])) {
echo '<b>Sessions are not enabled with this method.</b>';
} else {
echo 'Sessions work the $_SESSION[\'var\']='.$_SESSION['var'];
}
Edit: I see gagan is now online so he must spend a wider range of hours online than I thought.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259