Hi,
Have a noticed this kind of behaviour anytime while trying to read a cookie in ISAPI Filter. For some reason, I can't get it to work using SetServerVariable.
I have the code below.
GetHeader
char cookie[256];
DWORD cookielen=256;
pHeaderInfo->GetHeader(pfc,"Cookie:", cookie, &cookielen)
if (cookielen > 0){
x = pHeaderInfo->AddHeader(pfc,"MYUSER:", cookie);
}
When I read the header using
Request.Headers.Get("MYUSER"), I am getting ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ̉~±„üq'¤Z$W
once, I refresh the test page, I can see the value that I am setting in the cookie.
GetServerVariable
#define bufferSize 4096 //increase size if using many cookies
DWORD dwSize = bufferSize;
char szBuffer[bufferSize] = "\0"; //NULL;
pfc->GetServerVariable(pfc,"HTTP_COOKIE", szBuffer, &dwSize);
if (strlen (szBuffer) > 0){
x = pHeaderInfo->AddHeader(pfc,"MYUSER:", getUserName(szBuffer));
}