Is there a proc that returns the value of a cookie? Something like:
proc getCookie(req: Request, val: string): string =
let
c = req.headers.table.getOrDefault("Cookie", @[""])
cookies = c[0].parseCookies()
result = cookies.getOrDefault(val)
I did a search but didn't see a proc for this. I used the std lib for the parseCookies proc.
yeah, haven't implement such a api , I think you can do let c:string = req.headers["Cookie"]; let cookies = c.parseCookies(), import std/cookies first.
Is there a proc that returns the value of a cookie? Something like:
I did a search but didn't see a proc for this. I used the std lib for the
parseCookies
proc.