Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[Rails 3] Session option does not pass correctly

#4500

I'm trying to switch the session store in Rails 3 by changing the
config/application.rb as following:

config/application.rb

-----------------------------------

memcache_options = {
  :compression => true, 
  :debug => false, 
  :namespace => "xx-cache", 
  :readonly => false, 
  :urlencode => false 
} 
CACHE = MemCache.new(memcache_options) 
CACHE.servers = ['127.0.0.1:17898'] 

#check if CACHE is connected and can get value out 
#puts CACHE.get('key') 

config.action_dispatch.session = { 
  :key => '_xx_session', 
  :secret => 'xx', 
  :cache => CACHE, 
  :expires => 900 
} 
config.action_dispatch.session_store = :mem_cache_store

-----------------------------------

Memcache server is running. However, when run "rails s", i got this
message:
=> Booting WEBrick => Rails 3.0.0.beta3 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting
/usr/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta3/lib/ action_dispatch/middleware/session/mem_cache_store.rb:19:in
initialize': #<ActionDispatch::Session::MemCacheStore:0xa302950> unable to find server during initialization. (RuntimeError)

It seems the session option :cache was not passed correctly.

Reported by _obj · April 29th, 2010 @ 03:23 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • Tag cleared.
    • Importance changed from to Low

    Automatic cleanup of spam.

    November 8th, 2010 @ 08:27 AM

  2. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 9th, 2011 @ 12:31 AM

  3. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 9th, 2011 @ 12:31 AM