By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Php Session Problem

P: 2
Hello,

i have one application in that i use session .
problem is,
same code and session data use work successful in Firefox but not work in Internet Explore.

Thanks & Regards
Deepak
Jan 6 '08 #1
Share this Question
Share on Google+
3 Replies


Markus
Expert 5K+
P: 6,050
That's a shame.

Post the code you're using..
Jan 6 '08 #2

P: 2
That's a shame.

Post the code you're using..
//After login on home page
<?php
session_start();
session_register('id');
$_SESSION['id']=$userid; //user id after successful login
.

.
// bla bla bla
.


?>

//when i try to move to following page

<?php

session_start();
print_r($_SESSION); //some debugging info
die();
?>

the session array dont show the userid added

------------------------------------------------------------------------------------

After browsing the pages the session data shows correct in Firefox but empty session in IE.
Jan 6 '08 #3

P: 93
It's a bit hard to tell where it's going wrong without being able to play around with it. But try printing out the cookies that IE has sent to the page, if IE has not sent the PHPSESSID cookie back to you then you know... well you know that it's not sending the cookie back!!
[PHP]print $_COOKIE['PHPSESSID'];
//OR
print_r($_COOKIE);[/PHP]

If that does turn out to be the problem, then I would suggest installing Live HTTP Headers for FireFox. I know the problem is in IE, but being able to see the headers that are being sent is MASSIVELY useful when dealing with problems like this. You can see the HTTP header that sets the cookie, and you can see the headers that the browser sends back to PHP.

Hope that helps
Jan 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.