update method
Replaces the session data and writes the signed cookie to the response.
Implementation
Future<void> update(Map<String, dynamic> data) async {
_c.set(_sessionDataKey, data);
final payload = base64UrlEncode(utf8.encode(jsonEncode(data)));
final sig = _sign(payload, _secret);
setCookie(
_c,
_cookieName,
'$payload.$sig',
CookieOptions(httpOnly: true, sameSite: 'Lax', maxAge: _duration),
);
}