pandemonium_engine/modules/web/doc_classes/HTTPSessionManager.xml

71 lines
2.5 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="HTTPSessionManager" inherits="Node" version="3.8">
<brief_description>
The [HTTPSessionManager] class stores active sessions on a server.
</brief_description>
<description>
The [HTTPSessionManager] class stores active sessions on a server, and also has helper methods to create, save and delete sessions.
It should be placed as a child of a [WebServer], which will automatically pick it up. [WebNode]s should access it using the helper methods in [WebServerRequest].
The [SessionSetupWebServerMiddleware] is meant to be used alongside this class, which will automatically take session id from a request's cookie (if exists), and if it exists it will set the HTTPSession belonging to that id to the Request's session variable. Note that this will not create sessions automatically.
Although sessions can be created and set up manually, the [WebServerRequest] class also offers helper methods to do this.
Note that this class won't save the created sessions. Use one of it's inheritors, or inherit from it to implement your own serialization.
</description>
<tutorials>
</tutorials>
<methods>
<method name="add_session">
<return type="void" />
<argument index="0" name="session" type="HTTPSession" />
<description>
</description>
</method>
<method name="clear">
<return type="void" />
<description>
</description>
</method>
<method name="create_session">
<return type="HTTPSession" />
<description>
</description>
</method>
<method name="delete_session">
<return type="void" />
<argument index="0" name="session_id" type="String" />
<description>
</description>
</method>
<method name="generate_session_id">
<return type="String" />
<argument index="0" name="base" type="String" default="&quot;&quot;" />
<description>
</description>
</method>
<method name="get_session">
<return type="HTTPSession" />
<argument index="0" name="session_id" type="String" />
<description>
</description>
</method>
<method name="load_sessions">
<return type="void" />
<description>
</description>
</method>
<method name="remove_session">
<return type="void" />
<argument index="0" name="session" type="HTTPSession" />
<description>
</description>
</method>
<method name="save_session">
<return type="void" />
<argument index="0" name="session" type="HTTPSession" />
<description>
</description>
</method>
</methods>
<constants>
</constants>
</class>