Cookies(3)

πŸ“¦ version 1.0, in fedora 43, fedora 44

πŸͺ NAME

Cookies β€” like, the whole cookie situation, bestie πŸ’–

This is a page from the Library Functions Manual (Cookies(3), if you're keeping track, which you should be πŸ‘‘), and it's all about the cookie functions in LibCGI. Two of them. Both iconic. Let's go ✨


🧁 Functions

Okay so here's the roster, fr fr:

  • int cgi_add_cookie (const char *name, const char *value, const char *max_age, const char *path, const char *domain, const int secure) β€” Send a cookie to the client. πŸͺπŸ“€
  • char * cgi_cookie_value (const char *cookie_name) β€” Gets cookie value. πŸ•΅οΈβ™€οΈβœ¨

πŸ“– Function Documentation

Send a cookie to the client. That's it, that's the job. Main character energy, honestly πŸ’…

Parameters:

  • name β€” Cookie name 🏷️
  • value β€” Cookie value 🍬
  • max_age β€” Cookie time life, in seconds. A value equal to 0 ( zero ) means to discard the cookie when the session is done. ⏳ (yes bestie, zero, like, gone when the session dips ✌️)
  • path β€” Cookie path at the server πŸ›£οΈ
  • domain β€” Domain where cookie will work :) 🌐 (the original literally put a smiley there and honestly? we love that for them 🫢)
  • secure β€” Secure or not πŸ”’

See also:

cgi_cookie_value πŸ‘€ (go read it, it's right below, you got this)

cgi_add_cookie('mycookie', 'mycookie value', 0, 0, 0, 0);

^^ that's the vibe. all the zeros, no notes. πŸ’–


Gets cookie value. Like cgi_param(), cgi_cookie_value() returns the data contained in cookie_name cookie πŸͺ➑️✨

Parameters:

  • cookie_name β€” Cookie name to get the value 🏷️

Returns:

  • The cookie value πŸŽ€ (that's it. that's the return. slay.)

and that's the whole page, bestie!! you read all of it, periodt πŸ‘‘

this little gem came from LibCGI, dated 13 Mar 2003, and it's filed under Cookies(3) β€” go forth and set some cookies responsibly, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from