IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


int CGI_SetCookie ( const char *  name,
const char *  value,
const char *  domain,
const unsigned long *  expires,
const char *  path,
const int  secure,
rpCgiPtr  CgiRequest 
)

Creates a new cookie or modifies an old one.

Parameters:
[in] name Input Parameter: A pointer to a c-string which represents cookies-name.
[in] value Input Parameter: A pointer to a c-string which represents cookies-value.
[in] domain Input Parameter: A pointer to a c-string which represents cookies-domain. If you are not interest in the cookie-domain then you can pass a null pointer.
[in] expires Input Parameter: A pointer to an unsigned long which represents cookies-expire-time. If you are not interest in the cookie-expire-time then you can pass a null pointer.
[in] path Input Parameter: A pointer to a c-string which represents cookies-path. If you are not interest in the cookie-path then you can pass a null pointer.
secure This integer value defines the secure state of the cookie.
0: no secure cookie, !=0: secure cookie
[in] CgiRequest Input Parameter: The CGI request pointer which was passed to the CGI function.
Returns:
zero (CGI_COOKIE_ERR_OK), success, cookie was created.
-1 (CGI_COOKIE_ERR_SIZE), the cookie parameters in sum are too large. All cookies together must not be larger than 1024 bytes.
-2 (CGI_COOKIE_ERR_PARAM), invalid parameters, e.g. no cookie-name.
Note:
The argument strings are copied internal, so they are not required after the function call and could by deleted or modified.
Note that the date and time and also the timezone have to be set when you are using the expires argument.
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:
int result = CGI_SetCookie("username",
                           "otto",
                           NULL,
                           NULL,
                           NULL,
                           0,
                           CgiRequest);
if (result != CGI_COOKIE_ERR_OK)
{
   // ERROR!
}
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