#Set cookies from Middleware?

2 messages · Page 1 of 1 (latest)

versed dawn
#

Hi folks!

I see that the context.cookies is an AstroCookies which has a .set() method. Using this in frontmatter in Astro files AstroCookies.set()works perfectly, but using it in the middleware via context.cookies.set() does not work and the cookies are not set.

What is the best method/practice to set a cookie in middleware right before calling next()?

brazen hullBOT
#
Still waiting for an answer?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.