Joseph,
Thanks for your reply.
My question aimed to know if the could be any problem with caching
when declaring global sessions...
I don't know yet how to think about coding for GAE...
As for the test above, I did it with weapp and it worked seamlessly.
But when I replicated it with webpy (my favorite framework) which is
very similar to webapp, I got this error:
INFO 2008-05-24 10:54:36,405 dev_appserver.py] "GET / HTTP/1.1"
500 -
Traceback (most recent call last):
File "C:\Archivos de programa\Google\google_appengine\app1\web
\application.py"
, line 186, in wsgi
result = self.handle_with_processors()
File "C:\Archivos de programa\Google\google_appengine\app1\web
\application.py"
, line 158, in handle_with_processors
return process(self.processors)
File "C:\Archivos de programa\Google\google_appengine\app1\web
\application.py"
, line 155, in process
return self.handle()
File "C:\Archivos de programa\Google\google_appengine\app1\web
\application.py"
, line 147, in handle
return self._delegate(fn, self.fvars, args)
File "C:\Archivos de programa\Google\google_appengine\app1\web
\application.py"
, line 307, in _delegate
return handle_class(f)
File "C:\Archivos de programa\Google\google_appengine\app1\web
\application.py"
, line 298, in handle_class
return tocall(*args)
File "C:\Archivos de programa\Google\google_appengine
\luis1\main.py", line 15,
in GET
self.s = session.Session()
File "/var/www/svn/pkg/appengine-utitlies-0.2/utilities/session.py",
line 60,
in __init__
if self.validateSid() != True:
File "/var/www/svn/pkg/appengine-utitlies-0.2/utilities/session.py",
line 111,
in validateSid
self.__deleteSession(sid)
NameError: global name 'sid' is not defined
What could be wrong here?
Luis
On May 23, 11:19 pm, "
bowman.jos...@gmail.com"
<
bowman.jos...@gmail.com> wrote:
> Luis, anywhere you want to use session, just instantiate it (session =
> session.Session())
>
> Session (plus the other utilities I'm working on) are being built with
> the idea in mind that they should be able to support whatever
> framework you use them in. The webapp framework used in the demo was
> built directly from the examples Google provided. Just keeping it nice
> and simple.
>
> When you initialize session, it checks the browser to see if the
> session id cookie exists.If it does exist, it validates it, verifying
> that the same session id exists in the database (also checks the user
> agent and ip). It sounds like you're probably doing the right thing...
>
> self.session = session.Session()
> session["counter"] = session["counter"] + 1
>
> Wow, I'm so new to python, maybe someone else will come and say
> session["counter"]++
> exists... I don't know.
>
> On May 23, 6:47 pm, "Jorge Vargas" <
jorge.var...@gmail.com> wrote:
>
> > You may also want to take a look at Beakerhttp://
wiki.pylonshq.com/display/beaker/Homeit'strunk has a GAE