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 -- Posted via http://www.ruby-forum.com/.
Peter Fitzgibbons
2005-Dec-05 16:08 UTC
Re: Session differences between Apache and Webrick
On 12/4/05, Kevin Olbrich <kevin.olbrich-4+jYJfmkT58@public.gmane.org> wrote:> > 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 > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > 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). -- ------------------------------ Joyeux Noël ------------------------------ Peter Fitzgibbons _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails