# Active Record Sessions only work on localhost

**URL:** <https://www.ruby-forum.com/t/active-record-sessions-only-work-on-localhost/134486>\
**Category:** Rails\
**Created:** [April 11, 2008, 10:56am UTC](https://www.ruby-forum.com/t/active-record-sessions-only-work-on-localhost/134486 "2008-04-11T10:56:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarrold](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@jarrold](https://www.ruby-forum.com/u/jarrold)\
**Post date:** [April 11, 2008, 10:56am UTC](https://www.ruby-forum.com/t/active-record-sessions-only-work-on-localhost/134486/1 "2008-04-11T10:56:50Z")

</div>

Hi I was wondering if anyone else was having this problem or might  
know why its happening.

I basically need to use AR sessions instead of the default pstore for  
sessions so I did the rake db:sessions:create to get the migrate file  
and then the rake db:migrate to create the session table.

Also uncommented the below line in environment.rb

config.action\_controller.session\_store = :active\_record\_store

started the server and everything works as advertised on localhost  
(winxp, rails 1.2.3, ruby 1.8.6)

But when i did the same for my production machine (ubuntu, rails  
1.2.3, ruby 1.8.6) the sessions dont seem to work. First thing i  
noticed was that for each session, 4-5 entries were created in the  
sessions table while on my local machine only 1 entry was created.  
Can’t find any error messages in the logs either.

Any help ideas or anything is much appreciated, I couldn’t find any  
help anywhere else.

Thanks in advance,  
Jarrold
