I attempted to make a toy rails 2.3.5 application in Debian ''squeeze'' that uses the database to store sessions. My environment.rb is require File.join(File.dirname(__FILE__), ''boot'') Rails::Initializer.run do |config| config.action_controller.session_store = :active_record_store config.time_zone = ''UTC'' end My routes.rb is ActionController::Routing::Routes.draw do |map| map.root(:controller => ''application'') end My views consist of app/views/application/index.html.erb which contains Hello World <%= Time.zone.now %> I removed public/index.html. I ran ''rake db:sessions:create'' followed by ''rake db:migrate'' which created a table ''sessions'' in the postgres database ''railsapp_development''. The app starts without error and brings up the ''Hello World'' page. It doesn''t attempt to set a cookie and no row appears in the sessions table. What''s wrong? Thanks -- Nick -- 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.
On Jun 11, 3:41 am, Nick <rort...-DpUrGjegggHk1uMJSBkQmQ@public.gmane.org> wrote:> > > The app starts without error and brings up the ''Hello World'' page. It > doesn''t attempt to set a cookie and no row appears in the sessions > table. > > What''s wrong? >Rails won''t create a session until you try and use one, which you don''t appear to be doing Fred> Thanks > -- > Nick-- 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.
On 2010-06-11 01:19, Frederick Cheung wrote:> Rails won''t create a session until you try and use one, which you > don''t appear to be doingHow does one "use a session"?> Fred-- Nick -- 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.
u write in your controller session[:blala] if u not write it, u are not using session Ivan Nastyukhin dieinzige-BUHhN+a2lJ4@public.gmane.org On Jun 11, 2010, at 4:45 PM, Nick wrote:> On 2010-06-11 01:19, Frederick Cheung wrote: >> Rails won''t create a session until you try and use one, which you >> don''t appear to be doing > > How does one "use a session"? > >> Fred > > -- > Nick > > -- > 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. >-- 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.
On 2010-06-11 16:50, Ivan Nastyukhin wrote:> u write in your controller > session[:blala]That worked, thanks. -- Nick -- 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.