SP/web2py/applications/examples/controllers/session_examples.py
Saturneic 064f602b1a Add.
2018-10-25 23:33:13 +08:00

8 lines
206 B
Python

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)