I have Rails 2.3.2 and I want to disable session support for one controller action, so that means that I don''t want to save session variables to database when I''m accessing url. For example ''/my_action'' url. I have tried to implement this using session :off, :only => :my_action but this doesn''t work. The message I recieve is: DEPRECATION WARNING: Disabling sessions for a single controller has been deprecated. Sessions are now lazy loaded. So if you don''t access them, consider them off. You can still modify the session cookie options with request.session_options.. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Nov-11 15:12 UTC
Re: How can i disable session for one action in Rails
R00ted R. wrote in post #960744:> I have Rails 2.3.2 and I want to disable session support for one > controller action, so that means that I don''t want to save session > variables to database when I''m accessing url. For example ''/my_action'' > url. I have tried to implement this using session :off, :only => > :my_action but this doesn''t work. > > The message I recieve is: DEPRECATION WARNING: Disabling sessions for a > single controller has been deprecated. Sessions are now lazy loaded. So > if you don''t access them, consider them off. You can still modify the > session cookie options with request.session_options..Did you read the message? Did you notice the second sentence? Does that suggest anything? Have you tried that approach? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote in post #960749:> R00ted R. wrote in post #960744: >> I have Rails 2.3.2 and I want to disable session support for one >> controller action, so that means that I don''t want to save session >> variables to database when I''m accessing url. For example ''/my_action'' >> url. I have tried to implement this using session :off, :only => >> :my_action but this doesn''t work. >> >> The message I recieve is: DEPRECATION WARNING: Disabling sessions for a >> single controller has been deprecated. Sessions are now lazy loaded. So >> if you don''t access them, consider them off. You can still modify the >> session cookie options with request.session_options.. > > Did you read the message? Did you notice the second sentence? Does > that suggest anything? Have you tried that approach? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgYes, I have read this sentence. I''m not accessing any session variable or setting them but anyway system creates a session record, wich I don''t need. Maybe I don''t understand the idea. I need any suggestions.. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Brian Troutwine
2010-Nov-12 07:16 UTC
Re: Re: How can i disable session for one action in Rails
On Fri, Nov 12, 2010 at 2:15 AM, R00ted R. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Marnen Laibow-Koser wrote in post #960749: >> R00ted R. wrote in post #960744: >>> I have Rails 2.3.2 and I want to disable session support for one >>> controller action, so that means that I don''t want to save session >>> variables to database when I''m accessing url. For example ''/my_action'' >>> url. I have tried to implement this using session :off, :only => >>> :my_action but this doesn''t work. >>> >>> The message I recieve is: DEPRECATION WARNING: Disabling sessions for a >>> single controller has been deprecated. Sessions are now lazy loaded. So >>> if you don''t access them, consider them off. You can still modify the >>> session cookie options with request.session_options.. >> >> Did you read the message? Did you notice the second sentence? Does >> that suggest anything? Have you tried that approach? >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > > Yes, I have read this sentence. I''m not accessing any session variable > or setting them but anyway system creates a session record, wich I don''t > need. Maybe I don''t understand the idea. I need any suggestions..The session is not created until you check to see if the session is created. Do not check the session.> -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
So there is a problem, I''m not checking the session. I have empty ApplicationController and only 1 method in my controller which I''m calling. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Can I trace somehow, when the session is beeing created? -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Try to set a breakpoint to Session:marshal in activerecord/lib/active_record/session_store.rb -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.