cgi_cookie_set(3)

okay bestie, welcome to the cgi_cookie_set corner of the cgi/cgi.h world ✨ this is the one that hands a browser a cookie and is like "here, hold this for me πŸͺ". she's a section 3 girlie, a real one, no cap. let's get into it πŸ’…


🌸 NAME 🌸

cgi_cookie_set β€” set a browser Cookie πŸͺ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <cgi/cgi.h>

NEOERR *cgi_cookie_set (CGI *cgi, const char *name, const char *value,
                        const char *path, const char *domain,
                        const char *time_str, int persistent, int secure);

she's giving "eight arguments and not a single one is optional to look at" 😭 iconic honestly


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cgi β€” a CGI struct. the whole main character of the situation 🫢
  • name β€” the name of the cookie πŸͺ
  • value β€” the value you're setting that cookie to
  • path β€” optional path for which the cookie is valid. default is /
  • domain β€” optional domain for which the cookie is valid. you can use cgi_cookie_authority to figure out this domain. default is none, and the browser interprets "none" as the sending domain only πŸ‘€
  • time_str β€” expiration time string, formatted like this:
HH:MM: SS GMT

only used if persistent. default is one year from the time of the call ⏳

  • persistent β€” cookie will be stored by the browser between sessions πŸ’Ύ
  • secure β€” cookie will only be sent over secure connections πŸ”’

🌈 DESCRIPTION 🌈

so cgi_cookie_set will issue a Set-Cookie header that should cause a browser to return a cookie when required πŸͺ✨ that's the whole vibe. she's the messenger.

⚠️ okay but listen β€” this function does no escaping of anything. you have to take care of that first, bestie. she is NOT going to sanitize your inputs for you, that's on you fr fr πŸ™ˆ

and that's the tea β˜•


πŸ’œ RETURN VALUE πŸ’œ

none. she returns nothing. she just does the thing and leaves 😌 periodt


⭐ SEE ALSO ⭐

the whole friend group 🫢 go read these too:


and that's the page, bestie πŸ’–βœ¨ this one came to you from ClearSilver, dated 12 July 2007 πŸŽ€ a lil vintage, a lil iconic, we love her. stay safe out there and remember to escape your cookie values before you set them, ok bye πŸ‘‘πŸ’…πŸ¦‹