This module implements helper procs for parsing Cookies.
Procs
proc parseCookies(s: string): StringTableRef {.raises: [], tags: [].}
- parses cookies into a string table. Source
proc setCookie(key, value: string; domain = ""; path = ""; expires = ""; noName = false; secure = false; httpOnly = false): string {.raises: [], tags: [].}
- Creates a command in the format of Set-Cookie: key=value; Domain=...; ... Source
proc setCookie(key, value: string; expires: TimeInfo; domain = ""; path = ""; noName = false; secure = false; httpOnly = false): string {. raises: [ValueError], tags: [].}
-
Creates a command in the format of Set-Cookie: key=value; Domain=...; ...
Note: UTC is assumed as the timezone for expires.
Source