How To Read Cookies Using ASP and Visual C++ (241492)
The information in this article applies to:
- Microsoft Active Server Pages
This article was previously published under Q241492 SUMMARY
Please note that the sample described in this article is dependent on another article from the Microsoft Knowledge Base, Q240191 - How To Set Cookies Using ASP and Visual C++. Please follow the steps outlined in this KB article before proceeding with this article as many of the basic steps are assumed to have been completed.
This article describes how to read cookies from the Active Server Pages (ASP) Request object using a component written using the Active Template Library (ATL) and Visual C++.
Unlike reading cookies by means of a script on an ASP page, or from a Visual Basic component, you must use three (3) interfaces implemented by ASP to use this functionality. These interfaces (in order of use) are IResponse, IRequestDictionary, and IReadCookie.
The functional flow of reading cookies from a Visual C++ component is as follows: - Obtain the Response object from IScriptingContext or IObjectContext.
- Use the Response object to obtain an IRequestDictionary containing the Cookies collection.
- Use the Cookies collection to obtain the IReadCookie object, which will allow you to read cookies sent by the browser to the server.
REFERENCES
For additional information, please click the article number(s) below
to view the article(s) in the Microsoft Knowledge Base:
240191 How To Set Cookies Using ASP and Visual C++
239445 How To Obtain ObjectContext with ObjectControl Inside VC COM DLL from ASP and MTS
166279 How To Lifetime of a COM Component Under IIS, ASP, and RDS
159402 How To How To Use Response.Redirect in a Server Script
Modification Type: | Minor | Last Reviewed: | 7/2/2004 |
---|
Keywords: | kbASPObj kbCodeSnippet kbCookie kbhowto KB241492 |
---|
|