cgi/cookies.h File Reference

Cookies handling. More...

#include <time.h>
#include <cgi/cgi_config.h>
#include <cgi/headers.h>

Functions

int cookie_set (struct s_cgi_context *, char *, char *, time_t, char *)
 Set the cookie value.
int cookie_unset (struct s_cgi_context *, char *)
 Clear cookie.
const char * cookie_get (struct s_cgi_context *, char *)
 Get the cookie value.


Detailed Description

Cookies handling.

Author:
Vladimir Pavluk, 2006-2007
Cookies handling functions.

Function Documentation

const char* cookie_get ( t_cgi_context ctx,
char *  name 
)

Get the cookie value.

Returns value of the given cookie.

Attention:
WARNING: The returned string is not copied, so use it carefully (the best is to use it only for reading).
Parameters:
ctx pointer to existing CGI context (t_cgi_context *).
name cookie name.
Returns:
cookie value (char *).
See also:
cgi_context_create(FCGX_Request *)

cgi_context_free(t_cgi_context *)

cookie_set(t_cgi_context *, char *, char *, time_t, char *)

cookie_unset(t_cgi_context *, char *)

int cookie_set ( t_cgi_context ctx,
char *  name,
char *  value,
time_t  timeout,
char *  path 
)

Set the cookie value.

Sets value of cookie.

Parameters:
ctx pointer to existing CGI context (t_cgi_context *).
name cookie name.
value cookie value.
timeout cookie timeout.
path cookie path (can be NULL; defaults to "/").
Returns:
either CGI_OK or CGI_ERROR.
See also:
cgi_context_create(FCGX_Request *)

cgi_context_free(t_cgi_context *)

cookie_get(t_cgi_context *, char *)

cookie_unset(t_cgi_context *, char *)

int cookie_unset ( t_cgi_context ctx,
char *  name 
)

Clear cookie.

Clears the cookie from client's UA.

Parameters:
ctx pointer to existing CGI context (t_cgi_context *).
name cookie name.
See also:
cgi_context_create(FCGX_Request *)

cgi_context_free(t_cgi_context *)

cookie_set(t_cgi_context *, char *, char *, time_t, char *)

cookie_get(t_cgi_context *, char *)


Generated on Tue Jun 17 17:31:10 2008 for CGI Library by  doxygen 1.5.5