menu
dox_core package
documentation
http/response/dox_cookie.dart
DoxCookie class
DoxCookie class
dark_mode
light_mode
DoxCookie
class
Constructors
DoxCookie
(
String
key
,
String
value
, {
bool
encrypt
=
true
,
String
?
domain
,
String
?
path
,
bool
httpOnly
=
true
,
bool
?
secure
,
DateTime
?
expires
,
Duration
maxAge
=
const Duration(hours: 1)
,
SameSite
?
sameSite
})
Properties
domain
↔
String
?
getter/setter pair
encrypt
→
bool
final
expires
↔
DateTime
?
getter/setter pair
hashCode
→
int
The hash code for this object.
no setter
inherited
httpOnly
↔
bool
true by default, so page scripts can not read the cookie.
getter/setter pair
key
→
String
final
maxAge
↔
Duration
getter/setter pair
path
↔
String
?
getter/setter pair
runtimeType
→
Type
A representation of the runtime type of the object.
no setter
inherited
sameSite
↔
SameSite
?
SameSite
of the cookie, like
SameSite.lax
. null sends none.
getter/setter pair
secure
↔
bool
?
null by default: secure when the request came over https (see
req.scheme()
). set true or false to choose yourself.
getter/setter pair
value
→
String
final
Methods
expire
(
{
bool
https
=
false
})
→
String
set expire the cookie
get
(
{
bool
https
=
false
})
→
String
get the cookie to response in http response
noSuchMethod
(
Invocation
invocation
)
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString
(
)
→
String
A string representation of this object.
inherited
Operators
operator ==
(
Object
other
)
→
bool
The equality operator.
inherited
Static Methods
decrypt
(
String
name
,
String
value
)
→
String
?
The value of the encrypted cookie
name
, as the browser sent it, decrypted with the APP_KEY (or one of
AppConfig.previousKeys
). A changed cookie, one made with another key, or one made for another cookie name gives null.
req.cookie(name)
uses it.
dox_core package
documentation
http/response/dox_cookie
DoxCookie class
dox_cookie library