I have a situation where I need to know before a user gets to any pages on our site whether or not they have a certain cookie. It gets more complex than this, but I basically just need a simple tutorial or some information on how to use an ISAPI filter to read and test a cookie. Maybe ISAPI isn't a good way to do this, so I'm willing to hear alternative solutions as well.
I did find a tutorial on URL redirection via ISAPI (http://www.codeproject.com/isapi/isapiredirector.asp), which helped me get started toward understanding ISAPI, but now that I need to work with cookies I feel at a total loss. I've been playing with InternetGetCookie for hours with no luck and I haven't found any simple tutorials on the web, which makes me wonder if ISAPI filters are even something I should think about for doing this sort of thing.
Any help, insight or advice is appreciated. This one really has me stumped.
I haven't tried it myself, so I might not be accurate.
You would probably want to look for the notification, "SF_NOTIFY_PREPROC_HEADERS". In OnPreprocHeaders() method, you'll receive a HTTP_FILTER_PREPROC_HEADERS structure. One of the methods is GetHeader(). As you probably know, cookies are set in the HTTP header. You should be able to retrieve the Cookie using GetHeader().