Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #345: sessionbugtest.py

Line 
1 import cherrypy
2
3 class Test(object):
4     def index(self):
5         num = cherrypy.session.get('count', 1)
6         print "session gave us this initial value:", num
7         cherrypy.session['count'] = num + 1
8         print "session just incremented to", cherrypy.session['count']
9         if num % 5 == 0:
10             raise ValueError
11         return "You have viewed this page %s times" % num
12     index.exposed = True
13
14 cherrypy.root = Test()
15
16 cherrypy.config.update({'sessionFilter.on':True,
17 ##                        'sessionFilter.storageType':'file',
18 ##                        'sessionFilter.storagePath':'./'
19                         })
20
21 cherrypy.server.start()

Hosted by WebFaction

Log in as guest/cpguest to create tickets