Cookies(3)
πͺ 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
πͺ 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. 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 to0( 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. π
π char* cgi_cookie_value (const char * cookie_name)
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
- fedora 43: libcgi-devel 1.0-43.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: libcgi-devel 1.0-43.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: libcgi-devel 1.0-44.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: libcgi-devel 1.0-44.fc44 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms