Hi, Is there documentation on how to use CookieStore for sessions in rails 1.2.6? I have added this to environment.rb, but it''s not working. config.action_controller.session_store = { :session_key => ''_yummy_session'', :secret => ''seakret'' } Is there anything else I need to do? <snip> Thu Feb 07 04:28:16 -0500 2008 (25051) You have a nil object when you didn''t expect it! The error occurred while evaluating nil.restore /usr/lib/ruby/1.8/cgi/session.rb:304:in `[]'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:127:in `session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:155:in `stale_session_check!'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:110:in `session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1052:in `assign_shortcuts_without_flash'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/flash.rb:140:in `assign_shortcuts'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:424:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in `process'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/rails.rb:76:in `process'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/rails.rb:74:in `synchronize'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/rails.rb:74:in `process'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:155:in `process_client'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:154:in `each'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:154:in `process_client'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:281:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:281:in `initialize'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:281:in `new'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:281:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:264:in `initialize'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:264:in `new'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb:264:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/configurator.rb:282:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/configurator.rb:281:in `each'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/configurator.rb:281:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:128:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/command.rb:212:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:281 /usr/bin/mongrel_rails:19:in `load'' /usr/bin/mongrel_rails:19 </snip> Thanks, Mikey --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/7/08, Mikey Pitcher <mikey.pitcher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Is there documentation on how to use CookieStore for sessions in rails 1.2.6 > ? > > I have added this to environment.rb, but it''s not working. > > config.action_controller.session_store = { > :session_key => ''_yummy_session'', > :secret => ''seakret'' > } > > Is there anything else I need to do?You need to upgrade to Rails 2 which has the cookie store :) jeremy --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Seriously, I am wondering how to make cookie store work with rails 1.2x I cannot upgrade to 2.0.2. On Thu, Feb 7, 2008 at 10:04 PM, Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> > On 2/7/08, Mikey Pitcher <mikey.pitcher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > Is there documentation on how to use CookieStore for sessions in rails > 1.2.6 > > ? > > > > I have added this to environment.rb, but it''s not working. > > > > config.action_controller.session_store = { > > :session_key => ''_yummy_session'', > > :secret => ''seakret'' > > } > > > > Is there anything else I need to do? > > You need to upgrade to Rails 2 which has the cookie store :) > > jeremy > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 8 Feb 2008, at 03:01, Mikey Pitcher wrote:> Hi, > > Is there documentation on how to use CookieStore for sessions in > rails 1.2.6 ? > > I have added this to environment.rb, but it''s not working. > > config.action_controller.session_store = { > :session_key => ''_yummy_session'', > :secret => ''seakret'' > } > > Is there anything else I need to do? >Well at a bare minimum you''ll need to lift the cookie_store.rb from rails 2.0 and add it to your local copy of rails (if you''ve frozen your gems into vendor then you can do this without messing with your other rails apps. You''ll also have to modify session_management.rb to load cookie store, and hope that the interface that session stores present hasn''t changed much between 1.2 and 2.0 Fred> > <snip> > Thu Feb 07 04:28:16 -0500 2008 (25051) You have a nil object when > you didn''t expect it! > The error occurred while evaluating nil.restore > /usr/lib/ruby/1.8/cgi/session.rb:304:in `[]'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > cgi_process.rb:127:in `session'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > cgi_process.rb:155:in `stale_session_check!'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > cgi_process.rb:110:in `session'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:1052:in `assign_shortcuts_without_flash'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > flash.rb:140:in `assign_shortcuts'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:424:in `process_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:624:in `process_without_session_management_support'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > session_management.rb:114:in `process'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:330:in `process'' > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > `dispatch'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > rails.rb:76:in `process'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > rails.rb:74:in `synchronize'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > rails.rb:74:in `process'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 155:in `process_client'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 154:in `each'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 154:in `process_client'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 281:in `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 281:in `initialize'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 281:in `new'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 281:in `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 264:in `initialize'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 264:in `new'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > 264:in `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > configurator.rb:282:in `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > configurator.rb:281:in `each'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > configurator.rb:281:in `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:128:in > `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > command.rb:212:in `run'' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:281 > /usr/bin/mongrel_rails:19:in `load'' > /usr/bin/mongrel_rails:19 > > </snip> > > Thanks, > Mikey > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Feb 8, 2008 at 11:42 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 8 Feb 2008, at 03:01, Mikey Pitcher wrote: > > > Hi, > > > > Is there documentation on how to use CookieStore for sessions in > > rails 1.2.6 ? > > > > I have added this to environment.rb, but it''s not working. > > > > config.action_controller.session_store = { > > :session_key => ''_yummy_session'', > > :secret => ''seakret'' > > } > > > > Is there anything else I need to do? > > > Well at a bare minimum you''ll need to lift the cookie_store.rb from > rails 2.0 and add it to your local copy of rails (if you''ve frozen > your gems into vendor then you can do this without messing with your > other rails apps. You''ll also have to modify session_management.rb to > load cookie store, and hope that the interface that session stores > present hasn''t changed much between 1.2 and 2.0Oh. I got this splendid idea from reading Obie Fernandez''s book "The Rails Way" In it he says that if you want to use CookieStore with Rails 1.2x you need to use the above line. I guess the book is incorrect, if what you say is true.> > > Fred > > > > <snip> > > Thu Feb 07 04:28:16 -0500 2008 (25051) You have a nil object when > > you didn''t expect it! > > The error occurred while evaluating nil.restore > > /usr/lib/ruby/1.8/cgi/session.rb:304:in `[]'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > cgi_process.rb:127:in `session'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > cgi_process.rb:155:in `stale_session_check!'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > cgi_process.rb:110:in `session'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:1052:in `assign_shortcuts_without_flash'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > flash.rb:140:in `assign_shortcuts'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:424:in `process_without_filters'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:624:in `process_without_session_management_support'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > session_management.rb:114:in `process'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:330:in `process'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > > `dispatch'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > rails.rb:76:in `process'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > rails.rb:74:in `synchronize'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > rails.rb:74:in `process'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 155:in `process_client'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 154:in `each'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 154:in `process_client'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 281:in `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 281:in `initialize'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 281:in `new'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 281:in `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 264:in `initialize'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 264:in `new'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel.rb: > > 264:in `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > configurator.rb:282:in `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > configurator.rb:281:in `each'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > configurator.rb:281:in `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:128:in > > `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/ > > command.rb:212:in `run'' > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:281 > > /usr/bin/mongrel_rails:19:in `load'' > > /usr/bin/mongrel_rails:19 > > > > </snip> > > > > Thanks, > > Mikey > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---