<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css">
<title>
Gambas Documentation - Session
 (gb.web)</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../../help+en"><img class="flag" alt="Home" border="0" src="../../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../gb.web+en">Up</a>&nbsp;
<a href="response/setcookie+en">Previous</a>&nbsp;
<a href="session/abandon+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Session
 (gb.web)</h1>
This class is used for managing sessions.
<p>
A session is a collection-like container identified by a 32 hexadecimal digits random number. This identifier
is returned by the <a href="session/id+en">Session.Id</a> property.
<p>
The session identifier is stored in a cookie named 'SESSION' in the client browser.
<p>
<div class="black"><font size="-2"><b>Symbols</b></font></div>
<div class="border">
This class is static.<br>
This class acts like a <b><a class="none" href="session/_get+en">read</a></b> / <b><a class="none" href="session/_put+en">write</a></b> array.<br>
<hr><table class="none" cellspacing="0" cellpadding="0">
<tr>
<td align=left><b>Static&nbsp;properties</b></td><td width="32">&nbsp;</td>
<td align=left><b>Static&nbsp;methods</b></td><td width="32">&nbsp;</td>
</tr>
<tr valign=top>
<td>
<b><a class="none" href="session/id+en">Id</a></b>&nbsp;&nbsp; </td><td>&nbsp;</td>
<td>
<b><a class="none" href="session/abandon+en">Abandon</a></b>&nbsp;&nbsp; </td><td>&nbsp;</td>
</tr>
</table>
</div><p>

<h3>Storing values in session</h3>
<p>
The session can store values associated with string keys. You can store as many values as you want,
but there are restrictions: only native datatypes, arrays, and collections can be used.
<p>
The session contents are stored in the following file:
<pre class="code">"/tmp/gambas" &/ System.User.Id &/ "session" &/ Session.Id
</pre><p><p>
The session is automatically restored at program launch.
<p>
<h3>Session creation</h3>
<p>
A newly session is automatically created as soon as you store a session variable, and no session currently exists
(i.e. <a href="session/id+en">Session.Id</a> is <a href="../../lang/null+en">NULL</a>).
<p>
<h3>Session destruction</h3>
<p>
You can abandon a session by using the <a href="session/abandon+en">Abandon</a> method.

</div>
</body>
</html>

