cookie method
get cookie value from header. An encrypted cookie that was changed, made with another key, or made for another cookie name gives null.
req.cookie('authKey');
Implementation
@override
String? cookie(String key, {bool decrypt = true}) {
if (_cookies[key] == null) return null;
if (!decrypt) return _cookies[key];
try {
return AESEncryptor.decode(
_cookies[key],
Dox().config.appKey,
associatedData: key,
);
} on DecryptException {
return null;
}
}