The project name is hsd.  Code for the inherited base controller is
below.
session['_id'] field is available, but session['_creation_time'] and
session['_accessed_time'] fields do not seem to be available.  It
didn't seem to matter whether the code below that sets the cookie is
in the inherited base class, in __before__, or in the controller being
executed: same results. Perhaps I'm doing something incorrectly.

Edgar

-------------------

from pylons import request, response, session as session_cookies
from hsd.lib.base import BaseController, render
import hsd.model.meta as meta
import hsd.model as model
from datetime import datetime

class BasePlusController(BaseController):
        def __before__(self):
                if 'cre_dt' not in session_cookies:
                        session_cookies['cre_dt'] = datetime.now()
                session_cookies['acc_dt'] = datetime.now()
                session_cookies.save()


On Apr 14, 12:38 pm, Ben Bangert <[email protected]> wrote:
> On Apr 13, 2009, at 7:27 AM, edgarsmolow wrote:
>
> > I'm experiencing an issue with session cookies.
>
> > 1. I see that session['_id'] is created when a page on the site is
> > first encountered.  Are '_creation_time' and 'accessed_time' supposed
> > to be created automatically?  Or should those two fields be set in my
> > code?
>
> Those are both created for the first request.
>
> > 2. The code below is in the base controller.  A new session cookie is
> > produced (and new '_id' field) each time the same page is encountered:
>
> >                if 'cre_dt' not in session_cookies:
> >                        session_cookies['cre_dt'] = datetime.now()
> >                session_cookies['acc_dt'] = datetime.now()
> >                session_cookies.save()
>
> I'm going to need to see more of the code to answer that. What is
> session_cookies? Where in the BaseController is this? What does the
> actual controller you call to look like? Does it possibly override the
> method from the BaseController that is setting these?
>
> Cheers,
> Ben
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to