# Rails 2.3.3 session issue in production

**URL:** <https://www.ruby-forum.com/t/rails-2-3-3-session-issue-in-production/180613>\
**Category:** Rails\
**Created:** [December 23, 2009, 1:26am UTC](https://www.ruby-forum.com/t/rails-2-3-3-session-issue-in-production/180613 "2009-12-23T01:26:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [December 23, 2009, 1:26am UTC](https://www.ruby-forum.com/t/rails-2-3-3-session-issue-in-production/180613/1 "2009-12-23T01:26:33Z")

</div>

I have a problem that cropped up recently, on a site I built a while  
ago. The site has a shopping cart system, that relies on a session  
variable to store the ‘cart’ object.

The code works fine locally in development mode. But on the server it  
loses the session in the checkout process, after the first form page is  
sent - the next page loads and the cart has disappeared. Unfortunately,  
it was a couple of the clients customers that raised this issue :-/

Now I have been trawling the net looking for an answer and I have a  
feeling it may be due to new ‘lazy loading’ of sessions.

I have put in before\_filters to make sure that the session is called at  
every request apart from the user account controller. It still loses it  
at this one page…

Running Rails 2.3.3 on both development and production (server).

Any ideas much appreciated! Thx

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [December 23, 2009, 10:02am UTC](https://www.ruby-forum.com/t/rails-2-3-3-session-issue-in-production/180613/2 "2009-12-23T10:02:58Z")

</div>

Adam W. wrote:

> I have a problem that cropped up recently, on a site I built a while  
> ago. The site has a shopping cart system, that relies on a session  
> variable to store the ‘cart’ object.
> 
> The code works fine locally in development mode. But on the server it  
> loses the session in the checkout process, after the first form page is  
> sent - the next page loads and the cart has disappeared. Unfortunately,  
> it was a couple of the clients customers that raised this issue :-/
> 
> Now I have been trawling the net looking for an answer and I have a  
> feeling it may be due to new ‘lazy loading’ of sessions.
> 
> I have put in before\_filters to make sure that the session is called at  
> every request apart from the user account controller. It still loses it  
> at this one page…
> 
> Running Rails 2.3.3 on both development and production (server).
> 
> Any ideas much appreciated! Thx

Ok… sorry - it was a problem with the https apache config pointing to  
the old port number…
