Sun OpenSSO Enterprise 8.0 C API Reference for Application and Web Policy Agent Developers

am_web_is_cookie_present()

Detects whether a cookie is present.

Details

This function will most probably be invoked in a loop. A cookie name and value is passed and the implementation checks whether the cookie is already listed. If not, the new cookie name and value are appended. If present, the value of the cookie name is updated.

Syntax

#include "am_web.h"
AM_WEB_EXPORT int 
am_web_is_cookie_present(const char *cookie,
                         const char *value,
                         char **new_cookie);

Parameters

This function takes the following parameters:

cookie

Pointer to a cookie.

value

Pointer to a value.

new_cookie

Pointer to a pointer to the location of the new cookie.

Returns

This function returns one of the following integers as defined in <am_web.h>:

#define AM_WEB_COOKIE_EXIST             2
#define AM_WEB_COOKIE_MODIFIED          1
#define AM_WEB_COOKIE_ABSENT            0
#define AM_WEB_COOKIE_ERROR            -1