Page 1 of 1
Session variable is empty
Posted: Wed Dec 23, 2009 12:01 am
by venkyphp
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..
Re: Session variable is empty
Posted: Wed Dec 23, 2009 12:54 am
by Christopher
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.
Re: Session variable is empty
Posted: Wed Dec 23, 2009 3:08 am
by venkyphp
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...
Re: Session variable is empty
Posted: Tue Mar 02, 2010 12:57 am
by imran.rajani
you might be using session_register().
i've noticed this is not compatible with FF.
Re: Session variable is empty
Posted: Fri Apr 23, 2010 5:59 am
by pjcvijay
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'];
?>