# Memcached session storage not work for activerecord object?

**URL:** <https://www.ruby-forum.com/t/memcached-session-storage-not-work-for-activerecord-object/116954>\
**Category:** Rails\
**Created:** [October 11, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/memcached-session-storage-not-work-for-activerecord-object/116954 "2007-10-11T17:13:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 11, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/memcached-session-storage-not-work-for-activerecord-object/116954/1 "2007-10-11T17:13:51Z")

</div>

I use memcached to store session.  
It works great if store string in session, but not work if I store  
activerecord object.

for example,

[view1]  
\<% session[:k] = “test” %\>  
\<% session[:o] = User.find(1) %\>

[view2]  
\<%= session[:k] %\> # test  
\<%= session[:o] %\> # nil

I expect session[:o] will be object query from User.find(1), but it’s  
nil.  
any idea ?
