:mem_cache_store and memcache-client for session

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”

Rails::Initializer.run 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 = Hodel3000CompliantLogger.new(config.log_path)

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

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.server_settings = {
:address => “mail.domain.com”,
:port => 25,
:domain => “domain.com”,

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’

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?