Forum: Ruby on Rails Session differences between Apache and Webrick

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.
Kevin O. (Guest)
on 2005-12-05 06:47
Simple problem, really.

For starters, I am using InstantRails preview5....

I have a rails application that requires authentication, so I installed
the login_generator gem and set up my app to use it.

Now I want people to login right away and I want to then redirect them
to a particular controller/view after they do this properly.  So I set
up the correct before filters and everything is fine... except for this
annoying bug.

If a user goes to the root path, it asks for authentication... even if
they already logged in.

Near as I can tell, everytime I visit my root url, I get a new session
object.  If I do this with Webrick instead of apache, the session object
persists the way I would expect, and the problem goes away.

Is there something about the way apache handles virtualHosts that is
essentially starting a new session every time I hit the root URL?

More importantly, is there a way to fix it?

Thanks,

_Kevin
peter.fitzgibbons (Guest)
on 2005-12-05 18:12
(Received via mailing list)
On 12/4/05, Kevin O. <removed_email_address@domain.invalid> wrote:
> up the correct before filters and everything is fine... except for this
> essentially starting a new session every time I hit the root URL?
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


Are you using a root map in routes.rb ?

  map.connect '', :controller => "user", :action => "login"

Could be that apache is handling the / differently... My config is
sending
everything on the domain into rails (exceptions for static pages).

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