Re: [ruby-81] Sessions & Rails 2.3.2...

From: user 3.
Sent on: Thursday, August 27, 2009 6:28 AM
Jon,

I've heard of session problems with some older versions of Passenger. If you use passenger, either upgrade to the latest, or if on a shared facility, ask the admins to upgrade.

Also as of Rails 2.0 sessions are stored in the cookie by default not the database for performance reasons. One way I've been told to work around the Passenger issue is to set Rails to use db storage for sessions. It's a flag in environment.rb.

Also in dev mode you likely don't run Passenger and Apache but mongrel or webrick which don't have this issue.

Hope this helps.

Wolf

-- Sent from my Palm Pr��


Jon Seidel wrote:

Hi... I've got a problem upgrading from Rails 1.3.6 to 2.3.2 and friends.
��
I use the session to store a couple of small but critical pieces of information for my app; I use ActiveRecordStore for this.
��
Everything is working fine when I run the app in development mode; however, when I test it in production mode (either on my development box or actually deploying it to my site), it fails. What happens is that I logon using a known good id/password, the input is accepted, and then I am immediately returned to the login screen. The message I get is that my before_filter :login_required failed.�� When I debug it, I see that there's nothing in the session. (I know that some version of Rails 2.x implemented lazy-loading of sessions and that this is the case in 2.3.2).�� It also appears that there's nothing in the params array as well?�� I have tried referencing the session as soon as I enter my login method, but that hasn't helped.
��
A few possibilities come to mind; I'm sure there are others...
��
1. Was there also a change that affects CGI parameters? I saw in the release notes that some of the CGI functionality was moved to ActionController but I can't tell if that's an issue for my app.
2. I've been told by my hosting support that there were some session fixes in 2.3.3 to cleanup some 2.3.2 problems, but I don't want to just jump to another release without understanding what's going on.
3. Is there any way to just globally tell Rails: don't lazy-load sessions throughout the app? I checked the APIs and couldn't see anyway to do this.
��
What really baffles me is that it works in development and not in production mode... I've reviewed environment.rb and compared environments/production.rb to environments/development.rb and can't see what could be causing this.
��
Thanks for any help...jon
��

Jon Seidel, CMC��

EDP Consulting, Inc. / www.edpci.com / www.4mypasswords.com

Technology that means Business - Since 1979

3373 Guido Street

Oakland, CA 94602

phone: [masked]

fax: [masked]

��

The Certified Management Consultant (CMC) mark is awarded to consultants who meet the strict standards defined by the Institute of Management Consultants USA, including examination by their peers, client evaluations, and a written examination evidencing their understanding of the IMC USA's Code of Ethics.

Check out IMC USA for more information.

��




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jon Seidel ([address removed]) from The East Bay Ruby Meetup Group.
To learn more about Jon Seidel, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup Support: [address removed]
632 Broadway, New York, NY 10012 USA

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy