views:

85

answers:

0

Hi,

I have an app on a UK based server with server time set to GMT

The app should be set to Paris time so my settings include

TIME_ZONE = 'Europe/Paris'

I have sessions saving every request:

SESSION_SAVE_EVERY_REQUEST = True

For the most part I want the session time to be the default 2 weeks.

However when people want to book an item, I need to set the session to last just 10 minutes (so I can clear up after they've gone if they don't pay for the booking). So after 10 minutes of in-activity, the session will expire and I can clear up.

So in my add_to_basket view I do this:

request.session.set_expiry(10*60)

Looking at the sessions database table up to this point, all seems well - the session expiry time is set to 10 minutes into the future rather than 2 weeks. The time is set to Paris time as well.

However, once I click away from the page (to any other site page) the session expiry goes back an hour - to GMT?, so it becomes expired and my session is re-started.

Is this a bug? or are there some other settings I need to look at? Is there a certain order that I need to change the session dictionary? i.e. set a parameter, then do the expiry, then redirect etc.

If I set the TIME_ZONE to Europe/London these issues disappear...

Cheers

Guy