Rails 2.3.3 session issue in production

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

The code works fine locally in development mode.

How does it work locally in production mode? :slight_smile:

But on the server it loses the session in the checkout process

/

It still loses it at this one page...

I'd use Firebug to watch the request/response as you cross that point, checking the cookies particularly.

FWIW,

Do you force the SSL on the checkout process? What is the common name on the cert? Does it exactly match the FQDN you're accessing the site from before you start checkout?

Adam Wilson 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...