- Index
- »
- fan.web
- »
- WebSession
WebSession
abstract class WebSession : Obj
WebSession provides a name/value map associated with a specific browser "connection" to the web server. Any values stored in a WebSession must be both immutable and serializable. Get the current WebSession via WebReq.session.
See pod doc.
Return id
Set a session value which must be immutable and serializable
Get session value or return def if not defined
Get the unique id used to identify this session
Delete this web session which clears both the user agent cookie and the server side session instance
Application name/value pairs which are persisted between HTTP requests
Iterate the key/value pairs
Remove a session key
abstract Void delete()
Delete this web session which clears both the user agent cookie and the server side session instance. This method must be called before the WebRes is committed otherwise the server side instance is cleared, but the user agent cookie will remain uncleared.
abstract Void each(|Obj?,Str| f)
Iterate the key/value pairs
@Operator
abstract Obj? get(Str name, Obj? def)
Get session value or return def if not defined.
abstract Str id()
Get the unique id used to identify this session.
@Deprecated { msg="Use get, set, remove, each" }
abstract Str:Obj? map()
Application name/value pairs which are persisted between HTTP requests. The values stored in this map must be serializable.
abstract Void remove(Str name)
Remove a session key
@Operator
abstract Void set(Str name, Obj? val)
Set a session value which must be immutable and serializable.
virtual Str toStr()
Return id.