I have written two functions setSes() and getSes() and here I have written session_start().Its wroking for all browser except IE.
function setSes(){
$res=mysql_fetch_assoc(mysql_query("select * from table1 limit 1"));//data from DB
$_SESSION['ses1']=$res['name'];//Its not working .... $res['name']='Raj'
$_SESSION['ses1']="priyabrata";//Its working
}
function getSes(){
session_start();
print"<pre>";
print_r($_SESSION);
}
please get some ideas
The PHP Session writes a cookie, called
PHPSESSIDor something like that. You can change the name in php.ini or with special php functions.Anyway, the browser must accept cookies for sessions to work. IE (earlier versions, maybe even later) has an enforced security policy, which makes it hard to transmit cookies.
I suggest you read this article, which has a comprehensive study of this exact problem, and solutions.
I’ve been having this problem a lot with IE. If server timestamp was incorrect, or other server settings looked “fishy” to the cookie filter, the cookie was not accepted. Of course most of these security settings can be changed and turned off in IE, but it would have to be done on the client side, which isn’t appropriate.