Programming Guide |
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.
Web
- · The value of the specified cookie.
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
.
// 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")