# Mongrel, memcache and sessions

**URL:** <https://www.ruby-forum.com/t/mongrel-memcache-and-sessions/99344>\
**Category:** Rails\
**Created:** [July 21, 2006, 8:42pm UTC](https://www.ruby-forum.com/t/mongrel-memcache-and-sessions/99344 "2006-07-21T20:42:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sness](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sness](https://www.ruby-forum.com/u/sness)\
**Post date:** [July 21, 2006, 8:42pm UTC](https://www.ruby-forum.com/t/mongrel-memcache-and-sessions/99344/1 "2006-07-21T20:42:45Z")

</div>

Hi,

I’m using mongrel-0.3.13.3 with memcache-client-1.0.3 for storing  
sessions.  
It was working fine with actionpack-1.12.0, but when I upgraded to  
actionpack-1.12.3, I started getting a “can’t convert String into Hash”  
error from memcache.rb from memcache-client.

I was able to fix it by changing the way the MemCache object was created  
in  
actionpack/action\_controller/session/ mem\_cache\_store.rb from:

```
     @cache = options['cache'] || MemCache.new('localhost')

```

to:  
@cache = options[‘cache’] || MemCache.new()  
@cache.servers = ‘localhost’

I’m not sure how this would affect the other Ruby-memcache library, but  
thought this might  
be helpful to anyone else trying to figure out this problem.

yours,  
sness.

---

<div class="post-metadata">

**Author:** ![sness](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sness](https://www.ruby-forum.com/u/sness)\
**Post date:** [July 21, 2006, 8:55pm UTC](https://www.ruby-forum.com/t/mongrel-memcache-and-sessions/99344/2 "2006-07-21T20:55:47Z")

</div>

Hey Sness, can you try this with webrick to confirm it’s a Mongrel  
problem? It looks like a MemCache issue really.

---

<div class="post-metadata">

**Author:** ![sness](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sness](https://www.ruby-forum.com/u/sness)\
**Post date:** [July 22, 2006, 2:27am UTC](https://www.ruby-forum.com/t/mongrel-memcache-and-sessions/99344/3 "2006-07-22T02:27:33Z")

</div>

Hi Zed,

Great idea, thanks. I just tried it with webrick and confirmed that it  
is a  
memcache-client/actionpack issue.

yours,  
sness.
