Session class

Guest session record used for unauthenticated visitors.

Archery uses this model to track a visitor session token (stored in the archery_guest_session cookie) and last activity timestamp. This guest session is also used as the binding point for CSRF token association.

Inheritance
Mixed-in types
Available extensions

Constructors

Session({required String token})
Session.fromJson(Map<String, dynamic> json)

Properties

createdAt DateTime?
Creation timestamp (UTC).
getter/setter pairinherited
csrf String?
getter/setter pair
data Map<String, dynamic>
getter/setter pair
disk DatabaseDisk
getter/setter pairinherited
errors Map<String, dynamic>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id int?
Primary key (auto-incremented by backend).
getter/setter pairinherited
lastActivity DateTime
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
getter/setter pair
updatedAt DateTime?
Last update timestamp (UTC).
getter/setter pairinherited
user User?
getter/setter pair
uuid String?
UUID for cross-backend identification.
getter/setter pairinherited

Methods

belongsTo<T extends Model>({DatabaseDisk disk = Model.defaultDisk}) Future<T?>

Available on Model, provided by the Relationships extension

delete({DatabaseDisk? disk}) Future<bool>
Deletes the current instance.
inherited
hasMany<T extends Model>({DatabaseDisk disk = Model.defaultDisk}) Future<List<T>>

Available on Model, provided by the Relationships extension

hasOne<T extends Model>({DatabaseDisk disk = Model.defaultDisk}) Future<T?>

Available on Model, provided by the Relationships extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save({DatabaseDisk? disk}) Future<bool>
Saves the current instance.
inherited
toJson() Map<String, dynamic>
Serializes model data (excluding metadata).
override
toMetaJson() Map<String, dynamic>
Serializes metadata fields (id, uuid, timestamps).
override
toString() String
Human-readable string representation.
inherited
update({required Map<String, dynamic> withJson, DatabaseDisk? disk}) Future<bool>
Updates the current instance with new data.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

columnDefinitions Map<String, String>
getter/setter pair

Static Methods

init(HttpRequest request) Future<Session?>