atom feed3 messages in org.rubyonrails.railsRe: Session lost in Internet explorer
FromSent OnAttachments
Nick LinnellOct 27, 2005 8:02 am 
Nick LinnellOct 27, 2005 9:16 am 
Rodrigo Alvarez FernándezOct 27, 2005 2:02 pm 
Subject:Re: Session lost in Internet explorer
From:Nick Linnell (nick@public.gmane.org)
Date:Oct 27, 2005 9:16:17 am
List:org.rubyonrails.rails

I've managed to fix this now. The problem was to do with the domain name containing an underscore '_'. An IE bug?

Nick Linnell wrote:

Hi,

I've got an issue with session variables being lost in internet explorer. I have build a login system using the example used in Athentication ([1]http://wiki.rubyonrails.com/rails/pages/Authentication) in the rubyonrails wki. It works fine in Firefox but in IE my session variable is lost. If I check the value of @session["user"] after it is set in the login controller it has a value but in the next page the variable is empty

Am i doing something wrong? Thanks Nick

my code is as follows:

login_controller.rb

def authenticate if details = User.authenticate(@params[:login]["username"], @params[:login]["password"]) @session["user"] = details if @session["user"]["user_level"] == 1 redirect_to :controller => 'apps', :action => 'list' else redirect_to :controller => 'bugs', :action => 'list' end else flash["notice"] = "Login failed" redirect_to :action => 'index' end end

bug_controller.rb before_filter :authenticate

def index # stuff end

protected def authenticate unless @session["user"] redirect_to :controller => 'login' return false end end

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

_______________________________________________ Rails mailing list [2]Rails-1W37MKcQCpIf0INCOvqR/iCwE@public.gmane.org [3]http://lists.rubyonrails.org/mailman/listinfo/rails

-- Nick Linnell Kyanmedia Ltd 01483 548282 [4]http://kyanmedia.com

References

Visible links 1. http://wiki.rubyonrails.com/rails/pages/Authentication 2. mailto:rails-1w37mkcqcpif0incovqr/iCwE@public.gmane.org 3. http://lists.rubyonrails.org/mailman/listinfo/rails 4. http://kyanmedia.com/