How To Set Cookies Using ASP and Visual C++ (240191)
The information in this article applies to:
- Microsoft Active Server Pages
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Internet Information Server 4.0
This article was previously published under Q240191 SUMMARY
This article describes how to write cookies to a Web browser using the Active Server Pages Response object from a COM DLL created with Visual C++.
Unlike writing cookies through 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 IWriteCookie.
The functional flow of writing cookies from a VC 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 IWriteCookie object, which will allow you to write cookies and send them to a browser.
REFERENCES
For additional information, please click the article number(s) below
to view the article(s) in the Microsoft Knowledge Base:
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/13/2004 |
---|
Keywords: | kbASPObj kbCodeSnippet kbhowto KB240191 |
---|
|