method
session_store=
Ruby on Rails latest stable (v7.1.3.2)
-
1 note -
Class: ActionController::SessionManagement::ClassMethods
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (0)
- 2.0.3 (5)
- 2.1.0 (7)
- 2.2.1 (0)
- 2.3.8 (-9)
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
session_store=(store)
public
Register or
log in
to add new notes.
mutru -
June 18, 2008
8 thanks
Using memcached as a session store
Because of Ruby’s CGI library limitations, store cannot have any configuration options. Basically this means that you cannot easily run memcached on a different port (or with any non-default settings for that matter).
You can bypass this limitation with this ugly hack (environment.rb):
cache_params = *([memcache_servers, memcache_options].flatten) CACHE = MemCache.new(*cache_params) ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.merge!({ 'cache' => CACHE })
In your initializer block, just configure session_store normally:
config.session_store = :mem_cache_store
I think this should be fixed to work like cache_store= does.