This module implements helper procs for parsing Cookies.
proc parseCookies(s: string): StringTableRef {.raises: [], tags: [].}
proc setCookie(key, value: string; domain = ""; path = ""; expires = ""; noName = false; secure = false; httpOnly = false): string {.raises: [], tags: [].}
Set-Cookie: key=value; Domain=...; ...
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
.
© 2006–2017 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/cookies.html