On Apr 11, 12:01 pm, Ram <yourstruly.vi...@gmail.com> wrote:
> I guessed I should be checking that but I really couldnt figure out
> HOW to check them!

Wasn't thinking of anything more sophisticated than checking in your
browser's preferences.

Fred

> I use restful_authentication so where in the flow should i be raising
> an exception and what should i be throwing up to debug?
> Im actually pretty sure there're excess cookies hanging around.
> Because when I go to domain.com/login, it takes me right in and gives
> me a routing error cos of the subdomain absence. when i type in the
> url domain.com/logout, it goes to the login page, fails
> in :not_logged_in_required and takes me into the app again and throws
> the same routing error. So there is definitely a session hanging
> around. How do i clean that up?
>
> On Apr 11, 3:49 pm, Frederick Cheung <frederick.che...@gmail.com>
> wrote:
>
> > On Apr 11, 11:43 am, Ram <yourstruly.vi...@gmail.com> wrote:
>
> > > Im using Rails 2.1.0 so I understand the option is still
> > > session_options[:session_domain] for me (as opposed to session_options
> > > [:domain] for 2.2.0+)
>
> > > By the way, ive tried setting ActionController::Base.session_options
> > > [:session_domain] to both 'domain.com' and '.domain.com' but both give
> > > me the problems.
>
> > > Any idea what might be wrong?
>
> > Have you checked that the cookie is getting stored with the
> > appropriate domain  (and that you don't have excess session cookies
> > left hanging around from your experimentations) ?
>
> > Fred
>
> > > On Apr 11, 8:37 am, Andrew Timberlake <and...@andrewtimberlake.com>
> > > wrote:
>
> > > > >> Hi all,
>
> > > > >> Ive got a login form for users with the fields subdomain, username 
> > > > >> and
> > > > >> password. This is at the URLhttp://domain.com.
>
> > > > >> When the user submits the form and login is successful, i need the 
> > > > >> URL
> > > > >> to change tohttp://subdomain.domain.com/whatever.
> > > > >> How can I do this?
>
> > > > > You need to set your session cookie to apply to the whole domain (so
> > > > > that when it is set from the page at domain.com it is also sent when
> > > > > the browser requests subdomain.domain.com. It's one of the session
> > > > > options you can set in environment.rb
>
> > > > > Fred
>
> > > > >> My try was
>
> > > > >> if no_subdomain?
> > > > >>     redirect_to "http://#{params[:subdomain]}.domain.com/whatever";
> > > > >> else
> > > > >>     redirect_to whatever_path
> > > > >> end
>
> > > > >> But I think the session data is lost when you redirect like above. So
> > > > >> it takes me back to the login form.
> > > > >> Any ideas?
>
> > > > Set the following in your config/environments/production.rb file:
> > > > ActionController::Base.session_options[:session_domain] = 'domain.com'
> > > > This will store the session cookie on domain.com which will then also
> > > > be readable on subdomain.domain.com
>
> > > > Andrew 
> > > > Timberlakehttp://ramblingsonrails.comhttp://www.linkedin.com/in/andrewtimberlake
>
> > > > "I have never let my schooling interfere with my education" - Mark Twain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to