Início > comp > gb.web > session 
 en fr de es it nl pl pt mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Anterior  Próximo  Editar  Renomear  Desfazer  Procurar  Administração  
Documentação  
Cuidado! Esta página não está traduziada.  Veja a versão em inglês 
Session (gb.web)
This class is used for managing sessions.

Símbolos
Esta classe é estática.
Esta classe funciona como um array ler / escrever.

Propriedades estáticas  Métodos estáticos 
CookiePath  Id  Modified  Prefix  Timeout  Unique    Abandon  Load  Save   

What is a session?

A session allows you to keep the value of variables between two HTTP requests.

A session is a collection-like container identified by an arbitrary unique string returned by the Session.Id property.

That identificador has the following form: <PREFIX>:<KEY>

For example: 10.254.3.151:CFA76E086C00E18CF07A8EC

The session identifier is stored in a cookie named 'SESSION' in the client browser.

Storing values in session

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.

The session contents are stored in the following file:

"/tmp/gambas" &/ System.User.Id &/ "session" &/ Session.Id

The session is automatically restored at program launch.

Session creation

A newly session is automatically created as soon as you store a session variable, and no session currently exists (i.e. Session.Id is NULL).

If you call Response.Begin too early, the session cannot be created, as the HTTP headers have already been sent. You have two solutions then:

Session destruction

You can abandon a session by using the Abandon method.