Session variable is empty
Moderator: General Moderators
Session variable is empty
When i am using session variable for my application it is working fine for IE but when it comes to FireFox it is becoming empty..it is a critical issue..anyone can help me..plzzz..
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Session variable is empty
Are you doing a redirect on the page? If so you may need to call the session function to save the session data, because both pages are in a single request.
(#10850)
Re: Session variable is empty
No..not redirecting to the same page..i am just loading the image and adding the prefix to the image name by the session variable.. it is working fine in ie but not in FF..plz... suggest me the solution to this issue...
-
imran.rajani
- Forum Newbie
- Posts: 16
- Joined: Tue Dec 22, 2009 5:34 pm
Re: Session variable is empty
you might be using session_register().
i've noticed this is not compatible with FF.
i've noticed this is not compatible with FF.
Re: Session variable is empty
Hi,
session_start(); function should be called at the beginning of the php file, before retrieve or save session data.
session_write.php
<?php
session_start();
$_SESSION['user_name'] = 'Admin';
?>
session_read.php
<?php
session_start();
echo 'Current User: ' . $_SESSION['user_name'];
?>
session_start(); function should be called at the beginning of the php file, before retrieve or save session data.
session_write.php
<?php
session_start();
$_SESSION['user_name'] = 'Admin';
?>
session_read.php
<?php
session_start();
echo 'Current User: ' . $_SESSION['user_name'];
?>