SP/web2py/applications/examples/controllers/session_examples.py

8 lines
206 B
Python
Raw Permalink Normal View History

2018-10-25 15:33:07 +00:00
def counter():
""" every time you reload, it increases the session.counter """
if not session.counter:
session.counter = 0
session.counter += 1
return dict(counter=session.counter)