views:

54

answers:

1

I am running Rails 3 configured to use memcached for session store. I have the following setup:

development.rb

config.cache_store = :mem_cache_store

session_store.rb

Foo::Application.config.session_store :mem_cache_store, :key => '_foo_session'

I can start the app fine, when I go to any page I get the following error:

ArgumentError (key too long "rack:session:__really_long_session_key__"):

I realize the limit on memcached key is 255. How can I get around this, or am I doing something wrong?

A: 

If your "key" is more than 255 characters, it sounds like you are doing something wrong. Why is your session key that long? What's wrong with MD5 or SHA1?

webdestroya
I can't seem to figure out where this session key is coming from. I don't have that session key shown in the error specified anywhere in my app. Isn't the `:key => '_foo_session'` supposed to be the key?
Jey Balachandran
@Jay Bala - I'm not exactly sure where it is set.. I have never used Rack
webdestroya