cgiGetCookies(3)
β¨ cgiGetCookies(3) β¨
okay bestie, so this is a page from the Programmer's Manual, and it's literally the cutest lil cookie-fetching function in the whole CGI library. let's get into it π
πΈ NAME πΈ
cgiGetCookies β returns a list of cookies πͺ
π SYNOPSYS π
#include <cgi.h>
char **cgiGetCookies (s_cgi *parms);
ngl bestie, the manpage itself spells it "SYNOPSYS" and we are respecting that typo, it's iconic, we don't fix her π
π¦ DESCRIPTION π¦
so like. this routine returns a NULL terminated array of the names of cookies that were transmitted by the client. that's it, that's the whole vibe β just the names, bestie, not the values π
which means if you actually want the value of a cookie, you have to go use cgiGetCookie(3) for that. cgiGetCookies is just the lil guest list, not the gift bags π
and omg don't forget β to free the memory allocated for the array, use cgiFreeList(3). free your list, bestie, it's the responsible thing to do π«Ά
π RETURN VALUE π
- on success, a NULL terminated array of strings is returned β¨ and the last element is set to
NULL, as is tradition π - if an error occurred, or if no cookies were available at all,
NULLis returned π
so basically: no cookies = NULL. empty vibes. nothing in the cookie jar. tragic but valid π
π AUTHOR π
this CGI library is written by Martin Schulze <joey@infodrom.org>. and listen β if you have additions or improvements, please get in touch with him. he's asking, fr fr, don't be shy π
β SEE ALSO β
cgiGetValue(3)cgiGetVariables(3)cgiGetCookie(3)cgiFreeList(3)cgiDebug(3)cgiHeader(3)cgiInit(3)
reminder bestie: names only, usecgiGetCookie(3)for values, andcgiFreeList(3)to clean up. no cap π§
and that's the page!! sending you off with love from the CGI Library, dated 6 April 2008, signed cgiGetCookies(3) πβ¨ periodt.
π¦ where this page comes from
- ubuntu jammy: cgilib 0.6-1.1
- Copyright (c) 1999,2007,8 by Martin Schulze <joey@infodrom.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms