Problem with IE & Sessions

0 views
Skip to first unread message

Gaurav Arora

unread,
May 1, 2006, 6:44:55 AM5/1/06
to Professi...@googlegroups.com
This is the second time i'm facing this problem and I have no idea how
it fixed itself the first time. Bascically I have a login area which
uses sessions to identify and validate the user. The code works fine
in Firefox but for some reason the session can't be "remembered" in
IE. I've been struggling with this for hours now and can't figure out
what i'm doing wrong.

Any help would be most appreciated.

Thanks.

Kev

unread,
May 1, 2006, 11:46:50 AM5/1/06
to Professional PHP Developers
Firefox is a single session browser. I believe IE is a multi-session
browser. Do you open the pages in the same browser window or different
browser window?

AD7six

unread,
May 1, 2006, 12:00:04 PM5/1/06
to Professional PHP Developers
Hi Gaurav,

IE 6 doesn't seem to handle php session variables too well, there are
various alledged causes and solutions. See user comments at
http://es2.php.net/session and
http://es2.php.net/function.session-start

For my own dev site, the problem turned out to be that I had an
underscore in the url (as I had appended "_dev" to the domain) and this
prevented IE from setting the cookie to store the session ID.

Hope you find a solution,

AD7six

Gaurav Arora

unread,
May 2, 2006, 3:12:47 AM5/2/06
to Professi...@googlegroups.com
The code isn't running on a domain with an _ in the name. I tried all
of what was suggested in user comments and it still refuses to work.
The code snippet is :

<?php
session_start();
header('P3P: CP="CAO PSA OUR"');
require 'db.php';
if ($_POST['login']) {
$admin = qr("select * from ".$pre."admin");
$x = strcmp(md5($_POST['password']), $admin['password']);
if (!$x) {
$_SESSION['verify'] = md5($admin['password']);
session_write_close();
header("Location: admin.php?t=".time());
exit();
}
}
?>

The P3P header was suggested by someone on php.net so I added it.

Reply all
Reply to author
Forward
0 new messages