Problem with sessions and IE

Hello guys,

I have a very big issue with Internet Explorer and sessions!

Indeed, since I migrated my whole application to rails 2.1.1 from rails
1.2.3, IE doesn’t keep session at all.

example:

# controller

  def action1
    session[:foo] = 'foo'
  end

  def action2
    render(:text => "session[:foo] = " + session[:foo])
  end

Call action1 then action2.

If I use IE, session[:foo] will be empty after action2.

Everything works perfectly with all browsers but IE.
And obvisouly my Internet Explorer accept all cookies, all sessions with
lower security level etc…

I can also track what’s going on step by step because I store my
sessions in MySQL with active_record:

Actually, each time I call a new webpage (new action) with IE, rails
will automatically create a new session in the database with a new
session_id instead of taking the existing one. As usual, everything
works as intended with all other browsers.

I don’t know what to do anymore!
Down on my knees I beg you!

Help me please!

Thanks,

Mary

I tested script like yours in my IE and working fine here.

you can check your development.log maybe it help you.

good luck

It’s really wired actually!

Sometimes it works … sometines it’s not!

Sometimes IE will create a new session in my database for each new
action sometimes it will keep the existing session :confused:

thx anyway!

Rails T. wrote:

I tested script like yours in my IE and working fine here.

you can check your development.log maybe it help you.

good luck

I even created an example here:

http://88.191.83.87:8080/test/action1
then
http://88.191.83.87:8080/test/action2

Try with mozilla (work as intended) and then try with IE.
Wired isn’t it ?

Marie A. wrote:

I even created an example here:

http://88.191.83.87:8080/test/action1
then
http://88.191.83.87:8080/test/action2

Try with mozilla (work as intended) and then try with IE.
Wired isn’t it ?

open your config/environment.rb

UNCOMMENT IT:
config.action_controller.session_store = :active_record_store

and ADD it :

config.action_controller.perform_caching = true

And check your environment.rb

Have you change it, 1.2.3, to be 2.1.1 ???
RAILS_GEM_VERSION = ‘1.2.3’ unless defined? RAILS_GEM_VERSION

and open your Application.rb, make sure it is correct :

class ApplicationController < ActionController::Base

Pick a unique cookie name to distinguish our session data from

others’
session :session_key => ‘_ProjectName_session_id’

Y Reinhart A P
Blog : Teapoci.BlogSpot.Com

Thank you for all your answers and advices!

I checked evrything and just added the performing cache :confused:

But as you can check with both URL. I still have the problem :confused:

Rails T. wrote:

And check your environment.rb

Have you change it, 1.2.3, to be 2.1.1 ???
RAILS_GEM_VERSION = ‘1.2.3’ unless defined? RAILS_GEM_VERSION

and open your Application.rb, make sure it is correct :

class ApplicationController < ActionController::Base

Pick a unique cookie name to distinguish our session data from

others’
session :session_key => ‘_ProjectName_session_id’

Y Reinhart A P
Blog : Teapoci.BlogSpot.Com

Ok I found the problem!

I fixed it!

Thx!

Marie A. wrote:

Thank you for all your answers and advices!

I checked evrything and just added the performing cache :confused:

But as you can check with both URL. I still have the problem :confused:

Rails T. wrote:

And check your environment.rb

Have you change it, 1.2.3, to be 2.1.1 ???
RAILS_GEM_VERSION = ‘1.2.3’ unless defined? RAILS_GEM_VERSION

and open your Application.rb, make sure it is correct :

class ApplicationController < ActionController::Base

Pick a unique cookie name to distinguish our session data from

others’
session :session_key => ‘_ProjectName_session_id’

Y Reinhart A P
Blog : Teapoci.BlogSpot.Com

Hi,

I have also same problem of session in ie so can you say me how have
you solved it?

Thanks,

On Sep 27, 4:32 pm, Marie A. [email protected]

On Sat, Sep 27, 2008 at 4:32 AM, Marie A.
[email protected] wrote:

Ok I found the problem!

I fixed it!

So what was the fix?


Hassan S. ------------------------ [email protected]