IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


int CGI_GetCookie ( char **  name,
char **  value,
char **  domain,
char **  path,
char **  port,
char **  version,
rpCgiPtr  CgiRequest 
)

Returns the next available cookie.

Parameters:
[out] name Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the cookie-name.
[out] value Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the cookie-value.
[out] domain Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the cookie-domain. If you are not interest in the cookie-domain then you can pass a null pointer.
[out] path Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the cookie-path. If you are not interest in the cookie-path then you can pass a null pointer.
[out] port Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the cookie-port. If you are not interest in the cookie-port then you can pass a null pointer.
[out] version Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the cookie-version. If you are not interest in the cookie-version then you can pass a null pointer.
[in] CgiRequest Input Parameter: The CGI request pointer which was passed to the CGI function.
Returns:
zero (CGI_COOKIE_ERR_OK), success.
-3 (CGI_COOKIE_ERR_NONE), there was no more cookie found.
Note:
On the first call the function returns the first found cookie. On next calls the function returns the next found cookie, until no more cookie could be found. Note that this function must be called within the context of a CGI function. The pointers returned by the function are valid only while the CGI function is active. On return from the CGI function the pointer will become invalid.
Example:
char *name;
char *value;
char *domain;
char *path;
char *port;
char *version;

while ( CGI_GetCookie( &name, &value, &domain, &path, &port, &version ) == CGI_COOKIE_ERR_OK)
{
    // do something with the found cookie
    printf( "Cookie found:\r\n"
            "Name   : %s\r\n",
            "Value  : %s\r\n",
            "Domain : %s\r\n",
            "Path   : %s\r\n",
            "Port   : %s\r\n",
            "Version: %s\r\n",
            name, value, domain, path, port, version );
}
Since:
SC2x3 V1.00 - CLIB V1.00





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:36 2017 by Doxygen 1.6.1