# Sessions not working for active\_record\_store

**URL:** <https://www.ruby-forum.com/t/sessions-not-working-for-active-record-store/166037>\
**Category:** Rails\
**Created:** [April 21, 2009, 8:24am UTC](https://www.ruby-forum.com/t/sessions-not-working-for-active-record-store/166037 "2009-04-21T08:24:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [April 21, 2009, 8:24am UTC](https://www.ruby-forum.com/t/sessions-not-working-for-active-record-store/166037/1 "2009-04-21T08:24:00Z")

</div>

I just upgraded to rails 2.3.2 from rails 1.2.x and one of the issue  
was that I was getting an error of CookieOverflow.

Setup is Apache+Phusion+Rails 2.3.2+Mysql

So, I switched to active\_record\_store by uncommenting this line in  
enviroment.rb and creating sessions table -

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

Now, I am trying to set various values in session like -

session[:affiliate\_id] = \_affilID

But this is not working.

No error message is generated either. When I try to do  
session.inspect, couple of variables are getting set (all from 1  
action in application\_controller) -

{:guest\_clicks\_count=\>1}

Any ideas where the issue is?

Any help will be greatly appreciated.

Regards, Rajat

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [April 21, 2009, 9:09am UTC](https://www.ruby-forum.com/t/sessions-not-working-for-active-record-store/166037/2 "2009-04-21T09:09:48Z")

</div>

On Apr 21, 7:23 am, Rajat G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Now, I am trying to set various values in session like -
> 
> session[:affiliate\_id] = \_affilID
> 
> But this is not working.
> 
> No error message is generated either. When I try to do  
> session.inspect, couple of variables are getting set (all from 1  
> action in application\_controller) -

Did you restart your browser and the app after doing this? Also check  
that your session data isn’t bigger than the column you’re trying to  
store it in.

Fred

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [April 21, 2009, 8:53pm UTC](https://www.ruby-forum.com/t/sessions-not-working-for-active-record-store/166037/3 "2009-04-21T20:53:28Z")

</div>

I have done both…also, i expanded data to type largetext (in  
sessions table).

I am facing a weird problem now…we are setting layouts based on  
subdomain in before\_filter. Unfortunately, moment we do a search and a  
redirect happens, it does not render layout file at all and instead  
starts dumping just the inner content.

Any ideas?

Is this also session related or something else?

Please help.

On Apr 21, 12:09 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
