|
 |
 |
 |
Examples
|
[[ Spyce ]]
Python Server Pages by Rimon Barr |
examples/autosessionpost.spy
|
[[.import name=session args="'session_dir','/tmp', auto=(10,'post','mysession')"]]
<html><body>
[[-- count visits --]]
[[\
if not session.auto: session.auto = 1
else: session.auto = session.auto + 1
]]
[[-- output --]]
You have visited this page [[=session.auto]] time(s)<br>
Your autosession ID is: [[=session.autoID]]<br>
Autosession expiration = 10 seconds.<br>
<table><tr>
<td>
<form method=post>
<input type=submit value=Refresh>
<input type=hidden name=mysession value=[[=session.autoID]]>
</form>
</td><td>
<form method=post>
<input type=submit value=Clear>
</form>
</td>
</tr></table><br>
<b>Note:</b> This example requires write access to
the /tmp directory to function correctly.
</body></html>
|
Run this code.
(requires Spyce-enabled web server)
|
Back to List of Examples
|