Hi there,

I'm new to webpy and I was trying this sample for session handling.
It works, but the counter reachs 26 and then it starts over again at
1.

Why is that?
I don't see anything in the code to explain this behavior... Am I
missing something?

The script is this:
-------------------------------------------------------------------------------------------------------------------

import web
import os
from flup.middleware.session import DiskSessionStore,
SessionMiddleware

urls = ( '/', 'index')

class index:
    def GET(self):
        session = web.ctx.environ['com.saddi.service.session'].session
        if not 'hello' in session:
          session['hello'] = 1
        else:
          session['hello'] += 1
        print "Hello World: %d" % session['hello']

def session_mw(app):
    sessionStore = DiskSessionStore(storeDir="%s/sessions/" %
os.getcwd(), timeout=5)
    return SessionMiddleware(sessionStore, app)

if __name__ == '__main__':
    web.run(urls, globals(), web.reloader, session_mw)

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

Luis


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to