Skip to content
it4e edited this page Mar 21, 2016 · 3 revisions

Name

<chl/chl.h>

chl_cookies, CHL cookies

Declaration

char * chl_cookies(char * name);

Description

The chl_cookies function is used to get the value associated with the cookie [name].

Arguments

  • name: the name of the cookie.

Return value

A char pointer to the string value of cookie. 0 if cookie is not found.


Examples

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

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally