- 论坛徽章:
- 0
|
apache中cookie问题
static char* get_cookie(char *name, request_rec *r)
{
const char *cookie;
char *value;
char *cname = ap_pstrdup(r->;pool, name);
cname = ap_pstrcat(r->;pool, cname, "=", NULL);
if ((cookie = ap_table_get(r->;headers_in, "Cookie" ) != NULL)
{
ap_log_error( APLOG_MARK,APLOG_ERR,r->;server,"\n******cooke=%s",cookie);
if ((value = strstr(cookie, cname)) != NULL)
{
char *cookiebuf, *cookieend;
value += strlen(cname);
cookiebuf = ap_pstrdup(r->;pool, value);
cookieend = strchr(cookiebuf, ';');
if (cookieend)
*cookieend = '\0'; /* Ignore anything after a ; */
return cookiebuf; /* Theres already a cookie, no new one */
}
}
return NULL;
} |
|