What is web.session.Session in the python web.py module
<p>I'm currently learning Python and can't work out what the <code>web.session.Session</code> is in the follow game program:</p>

<pre><code>app = web.application(urls, globals())
session = web.session.Session(app, web.session.DiskStore('sessions'), initializer={'room': None})
</code></pre>

<p>What are <code>app</code>, <code>Diskstore</code>, and <code>initializer</code>?</p>

<p>This <code>web.session</code> module gives you the session support, </p>

<ul>
<li><p><code>initializer</code> - You can set the initial session which is not mandatory.</p>

<p>eg: <code>initializer={'room': None}</code> sets the initial session of room to None.</p></li>
<li><p><code>DiskStore</code> makes the session to save in disk whereas <code>DBStore</code> stores session in databases.</p></li>
<li><code>app</code> gives the application instance created as
<code>web.application(urls, globals())</code> with URLs which mapped to the relevant classes.</li>
</ul>

<p>Refer <a href="http://webpy.org/cookbook/sessions" rel="nofollow">this</a>.</p>

python web.py