Programming Guide



sm_web_get_cookie

Returns the value of the specified cookie

#include <smuweb.h>
char *sm_web_get_cookie(char *cookie_name);

cookie_name
The cookie whose value you want to retrieve.

Environment

Web

Returns

Description

sm_web_get_cookie returns the value of the specified cookie. The cookie must already exist in the user's browser program.

If the same cookie name is present more than once, only the first one is returned by this function. The entire cookie string is available as @cgi_http_cookie.

Example

// Get the browser's cookie values for user and visit_num
// and insert those values into the user and visit_num
// fields on the screen. Then, the visit_num cookie is reset
// to its new value.

proc entry

user = sm_web_get_cookie("user")
visit_num = sm_web_get_cookie("visit_num")
visit_num = visit_num + 1
call sm_web_set_cookie("visit_num=:visit_num;\
expires=Monday, 03-Jan-2030 00::00::00 GMT; \
domain=.Panther.com; path=/samples")

See Also

sm_web_set_cookie