From 5daba46fb42ec7711ab4156b930952d403678c36 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 2 Oct 2012 10:36:43 +0200 Subject: [PATCH] set default session age to 2 month, change session in init so it expires 2 months after the last init call. fixes #1056 --- pandora/app/views.py | 2 ++ pandora/settings.py | 1 + 2 files changed, 3 insertions(+) diff --git a/pandora/app/views.py b/pandora/app/views.py index c78f5e48..5601b095 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 import copy +from datetime import datetime from django.shortcuts import render_to_response, redirect from django.template import RequestContext @@ -159,6 +160,7 @@ def init(request): response['data']['site'] = config response['data']['user'] = init_user(request.user, request) + request.session['last_init'] = str(datetime.now()) return render_to_json_response(response) actions.register(init) diff --git a/pandora/settings.py b/pandora/settings.py index c81b3135..c36cba89 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -190,6 +190,7 @@ USE_IMDB = False VIDEO_PREFIX='' #VIDEO_PREFIX='videoPART.example.com' #SESSION_COOKIE_DOMAIN=*.example.com" +SESSION_COOKIE_AGE=60*24*60*60 SCRIPT_ROOT = normpath(join(PROJECT_ROOT, '..', 'scripts')) #change script to customize