IHP 1.0 is out now!

Setting Cookies

peterbuckley17 PRO

I'd like to set cookies to manage access to a service via Cloudfront. Is there a best-practice way of setting a simple cookie {key}={value}?

I'm having trouble parsing through the Session cookie code for inspiration.

marc PRO

Right now this is not easily possible. As a workaround you could set the Set-Cookie header manually like this:

action MyAction = do
    setHeader ("Set-Cookie", "key = value")

I've created an issue on GitHub for adding helpers for this: https://github.com/digitallyinduced/ihp/issues/1326