-
Notifications
You must be signed in to change notification settings - Fork 10
chl_set_cookie
it4e edited this page Dec 12, 2016
·
3 revisions
<chl/chl.h>
chl_set_cookie, CHL set cookie
void chl_set_cookie(char * name, char * value, char * expires);
The chl_set_cookie function is used to set the cookie [name] with the value [value].
- name: the name of the cookie.
- value: the value of the cookie.
- expires: lifetime of cookie in format: Wdy, DD-Mon-YYYY HH:MM:SS GMT. Set this to NULL for session.
No return value.
main.c
#include <chl/chl.h>
#include <stdio.h>
int main() {
chl_set_cookie("name", "Olof", NULL);
chl_print_headers();
char * value;
if((value = chl_cookies("name")))
fputs(value, stdout);
}
Output: Olof