DVSessionScope class final

Which hosts share one browser session.

Constructors

DVSessionScope.host({List<String> hosts = const <String>[]})
Every host keeps a host-only __Host- cookie. hosts are the application's own serving hosts, when it declares any: a state-changing request from anywhere else is refused.
const
DVSessionScope.site({required String domain, required List<String> hosts})
The session spans every one of hosts under domain.
const

Properties

domain → String?
The registrable domain (or a parent of every covered host under it) the session cookie is set for, or null for host-only cookies.
final
hashCode → int
The hash code for this object.
no setterinherited
hosts → List<String>
The application's own serving hosts: exact names and *. patterns from dartvel.hosts, redirecting hosts left out.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

allowsOrigin(String? origin, {String? host, bool secure = true, Iterable<String> alsoAllowed = const <String>[]}) → bool
Whether a state-changing request carrying origin, made to host, is the application's own.
covers(String? host) → bool
Whether a request on host gets the domain cookie: the application declares it, and it is domain or below it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
override
validate() → void
Throws DVSessionConfigError when domain is a public suffix, not a domain at all, or covers none of hosts: the start-time half of what resolve reports at build time.

Operators

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

Static Methods

requestHost(Request request) → String?
The host request was made for: X-Forwarded-Host from a peer dartvel.server.trustedProxies trusts, Host otherwise.
requestSecure(Request request) → bool
Whether request arrived over https, as the proxy in front says (x-forwarded-proto) or the request's own URL does.
resolve({required DVHosts hosts, Object? auth}) → DVSessionScopeResolution
The scope dartvel.hosts and dartvel.auth describe.

Constants

hostScope → const String
siteScope → const String
The values dartvel.auth.sessionScope takes.