Using sessions in TurboGears

To use sessions in TurboGears, you must first enable sessions in your config files (dev.cfg, prod.cfg) by adding this line to the global section:

session_filter.on = True

To demonstrate sessions, we'll build a simple counter:

Refreshing the page should cause the counter to increase.

The CherryPy site offers additional details of session configuration.