SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast craigv's Avatar
    Join Date
    Dec 2003
    Location
    minneapolis, mn
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ISAPI FIlters / IIS help and advice needed

    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.

    Btw, I'm on IIS 5.0.

    Thanks,
    Craig

  2. #2
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Internet
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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().


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •