Forum: Ruby on Rails :mem_cache_store and memcache-client for session

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bf1e5a140a444bdc5011185bba3a1ed3?d=identicon&s=25 Sharkie Landshark (sharkie)
on 2007-07-11 17:24
Seems to not be working in that there is no error, but my Rails app is
not keeping track of any session. Fragment cache is working, however. I
have tried many different ways, but just can't get this to work. My
memcached-vv also looks normal. Can someone please help me, or tell me
where to start looking.


require File.join(File.dirname(__FILE__), 'boot')
require_gem 'memcache-client'

memcache_options = {
   :compression => false,
   :debug => false,
   :namespace => 'domain',
   :readonly => false,
   :urlencode => false
memcache_servers = "localhost:11211" do |config|
    config.action_controller.session_store = :mem_cache_store
  config.action_controller.fragment_cache_store = :mem_cache_store,
memcache_servers, memcache_options
  #config.action_controller.fragment_cache_store = CACHE, {}
'cache' => CACHE })

  require 'hodel_3000_compliant_logger'
  config.logger =

cache_params = *([memcache_servers, memcache_options].flatten)
CACHE = *cache_params
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.merge!({ 'cache'
=> CACHE })

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.server_settings = {
  :address => "",
  :port => 25,
  :domain => "",

ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"

require 'RMagick'
include Magick
require 'cgi'
require 'cached_model'
require 'misc'
Bf1e5a140a444bdc5011185bba3a1ed3?d=identicon&s=25 Sharkie Landshark (sharkie)
on 2007-07-11 18:22
I am suspecting that my session breaks when I place a model into the

Example: session[:user] = @user

where @user is a Rails model.

Is this to be expected?
This topic is locked and can not be replied to.