Forum: Ruby on Rails That problem with Sessions on IE6

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jason R. (Guest)
on 2007-06-01 18:56
(Received via mailing list)
Does *anyone* know how to fix this problem? I've seen only a few people
who
have worked on this problem, but no-one has posted what exactly is
happening
and how to fix it.

Basically, I lose my session randomly while on IE6. The site works
perfectly
fine on any other browser.

My setup:

Apache w/ FastCGI
Rails Edge 6512 (1.2.x)
ActiveRecordSessionStore
MySQL
Ubuntu 6.06

This is driving me absolutely nuts. Can anyone help me here?

Thanks

Jason
John T. (Guest)
on 2007-06-01 19:08
(Received via mailing list)
On 6/1/07, Jason R. <removed_email_address@domain.invalid> wrote:
> Rails Edge 6512 (1.2.x)
> ActiveRecordSessionStore
> MySQL
> Ubuntu 6.06
>
> This is driving me absolutely nuts. Can anyone help me here?
>
> Thanks
>
> Jason

Are you opening another window (via Javascript)? In a previous life,
in an ASP application (which stored a session ID in a cookie), when
the code would open another window, the session ID would get reset,
effectively erasing the session variables I had. Took forever to
figure out what was happening. Unfortunately, I could never find a fix
- it's a nasty bug in IE.
Jason R. (Guest)
on 2007-06-01 19:28
(Received via mailing list)
This is straight running through the application. No new windows, only
simple display Javascript. I just tried with pStore, and I noticed that
the
date on the server was off, but fixing that didn't change a thing.

I guess I have to not use the session. The odd thing for me is that I
can
use the session, just not here. People can log into the site just fine,
though yeah, the session must be getting reset for me too as when the
site
dies, the person is logged out.

This is unreal.

Jason
Jason R. (Guest)
on 2007-06-01 20:07
(Received via mailing list)
Ok, I finally found a lead. Aparently, IE 6 (and maybe 7) suck at
handling
sessions. Basically after the session size gets to 4k or 20 cookies for
a
given domain name, IE drops the session cookie first to make space.

So for now I'm fixing this code to use the session as little as possible
(which is a good idea anyway).

Jason
Jason R. (Guest)
on 2007-06-01 21:49
(Received via mailing list)
To have a sense of closure on the thread:

My issue is something special. I don't know how this worked in any
browser.
Basically I wasn't losing the whole session, just two fields that
corresponded to foreign keys. So:

session[:obj] = {
  :for_key_1_id => 1,
  :for_key_2_id => 3,
  :some_string => "string"
}

became

session[:obj] = {
  :for_key_1_id => nil,
  :for_key_2_id => nil,
  :some_string => "string"
}

I think this happened when I pulled out the information for a view:

def action
 @for_key_1_id = session[:obj][:for_key_1_id]
 @for_key_2_id = session[:obj][:for_key_2_id]
end

like this information was GC'd, or just lost. Why I have no idea, and
what's
even more confusing as to why this worked in Firefox.

Hack fix: save the values twice in the session.

I'm so confused.

Jason
Juanma C. (Guest)
on 2007-06-03 13:05
Well, I have spent three days trying to resolve the same issue.
Finally I caught the problem.
I don´t know if my case applies to yours but I will talk about mine, and
maybe it can help you.

I will try to explain the thing in a simplified sample.
I have written a REST application for controlling production in a plant.
People login with the machine they are working at that moment, and the
first page shows information about the current operarion in that
machine. Sometimes there was a image of the product they are
manufacturing, but others there wasn`t.
It warks without problem with firefox, but not with IE6 or IE7.
The page was always displayed correctly, the image was not showed.
Everything continued well with firefox but not with the Microsoft
browsers.
In these, the next action you try always redirected to the login page,
as if the registered machine_id in session were lost.
I study the logs made with firefox and ie with a diff application, and
see that IE made a weird access to the server when it need the image
that was not there.
It request an url that was not planned, calling the index action insted
the show with and id. I don´t know why.
What happend was that this call was cancelled by a filter, and
redirected to the login action where I reset the session information.
Actually it wasn`t IE that missed the session as I thought.

Maybe it can help you.
Good luck.

Juanma
This topic is locked and can not be replied to.