Jump to content

ie session problems


r0k3t

Recommended Posts

Hi there,

I have researched many a thread on this but still haven't found the answer. This happens with ie6 and 7. For some reason maybe one out of eight times my sessions work mostly though I just have a problems with it I do a phpinfo(); and I can see that the session ID is different. Everything always works in firefox just not IE. I tried setting "session.auto_start = 1" no help, I tried setting "session.use_trans_sid = 1" doesn't help either. What gives... I mean sessions are not that hard to deal with... All you have to do is call session_start() if auto_start = 0 and $_SESSION['blah'] = "blah" or in my case if you are passing objects around you serialize them first... How could this be so frustrating.

Also - A tried to donate but I can't log in there, I can log in just fine for this part but that part always tells me I am not logged in and that my login failed. What's up with that? I would like to donate but heck yeah I want some glory for it!

Thanks
Ken
Link to comment
Share on other sites

Yeah, I tried echoing my session variables... The problem is that the session array is empty and I have a new session id "almost" everytime with IE 6 and 7, every once in a while it will work. I am totally stumped, here is some code.
---------from login.php------------------------
if($num_rows == 1)
{
        $userObject = new user;
        $row = mysql_fetch_array($result);
        $userObject->setUserName($row['username']);
        $userObject->setAuthLevel($row['authlevel']);
        $serializedUserObj = serialize($userObject);
        $_SESSION['userObject'] = $serializedUserObj;
        ?>
                <a href='http://fedora5/tfgmanager.02/mainMenu.php'>
                Click to continue
                </a>

        <?
        echo $_SESSION['userObject'];
        //phpinfo();
        //header( 'Location: http://fedora5/tfgmanager.02/mainMenu.php' );
} else {
        include('./htmltop.php');
        echo "<p id='error'>Sorry, there has been a login error</p>";
}
------from mainMenuTop.php (which is an include in mainMenu.php) ------------------
<?
session_start();
include('./htmltop.php');
include('./classes/class.user.php');
$serializedUserObj = $_SESSION['userObject'];
echo $serializedUserObj;

$userObject = unserialize($_SESSION['userObject']);

if(isset($_POST['menu'])){
        $menu = $_POST['menu'];
}
Link to comment
Share on other sites

Hi

Does anyone have any info that might point me in the right direction? I tried implementing a p3p policy... It seems to work fine but doesn't solve the problem. Like I said, it works in firefox every time and once about every ten tries it will work in ie6 or 7. ie always tells me the cookie has been accepted! Why would it work in firefox and NOT ie (usually)?

*shrug* I don't know what else to do but abandon php

Ken
Link to comment
Share on other sites

I notice a header(...) redirect in your code (commented out, probably for testing purposes). Put an [b]exit;[/b] statement after any header redirects to prevent the code following it from being executed.

Also, is any of this switching back and forth between http and https pages?
Link to comment
Share on other sites

Yeah, as you can see I totally tried that. I tried just creating a link to the main page after you log in but that doesn't solve the problem. It actually works either way in firefox and like I said "every once in a while will work either way in IE" yesterday I used IE6 and logged in twice and everything worked just fine then it stopped working?

I listed the versions of php below maybe that will help someone point me in the right direction.

php-ldap-5.1.6-1.2
php-mysql-5.1.6-1.2
php-pear-1.4.6-2
php-5.1.2-5
php-pdo-5.1.6-1.2
php-odbc-5.1.6-1.2

Thanks!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.