IPC@CHIP® RTOS-LNX – API Documentation

Header image

Main page


◆ CGI_GetCookie()

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

Returns the next available cookie.

Parameters
[out]nameOutput 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]valueOutput 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 or to NULL if the cookie has been removed.
[out]domainOutput 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 or to NULL if the cookie has been removed. If you are not interest in the cookie-domain then you can pass a null pointer.
[out]pathOutput 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 or to NULL if the cookie has been removed. If you are not interest in the cookie-path then you can pass a null pointer.
[out]portOutput 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]versionOutput 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]CgiRequestInput 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
V0.80





Top of page | Main page

Copyright © 2018 Beck IPC GmbH
Generated on Tue Jul 10 2018 14:54:14 by Doxygen 1.8.13