cp_socket

Section: cp_socket (3)
Updated: OCTOBER 2005
Index Return to Main Contents
 

NAME

cp_http_session - http session object  

SYNOPSIS

#include <cprops/http.h>

void *cp_http_session_get(cp_http_session *session, char *key);
void *cp_http_session_set(cp_http_session *session,
                           char *key, void *value);
void *cp_http_session_set_dtr(cp_http_session *session,
                               char *key, void *value,
                               cp_destructor_fn dtr);
void cp_http_session_set_validity(cp_http_session *session,
                                   long sec);
short cp_http_session_is_fresh(cp_http_session *session);

 

DESCRIPTION

If configured with support for http sessions, http services may create a session by calling cp_http_request_get_session (3). Sessions are implemented with browser cookies if supported by the client or with url rewriting otherwise. When a new session is created the fresh flag on it is set so that cp_http_session_is_fresh returns non-zero. In normal operation, when the service function returns cp_http_response object is written to the client. However when a service function creates a new session, the response is set pending and the client receives a redirect to a fixed uri to allow the framework to determine whether it supports cookies. The pending response is written to the client in response to the redirect request. On subsequent calls to the service function cp_http_session_is_fresh returns 0.

cp_http_session_set sets the value value under the key key. cp_http_session_set_dtr allows setting a destructor function to be called on the stored value to perform cleanup. No cleanup is done on items stored with cp_http_session_set or with cp_http_session_set_dtr if the specified destructor is null.
cp_http_session_get retrieves the value stored under key key.

cp_http_session_set_validity sets the session validity to sec seconds. Default validity is 24 hours.

 

SEE ALSO

cp_http_request_get_session(3), cp_http_service(3), cp_httpsocket(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:26:15 GMT, January 30, 2006
SourceForge.net Logo