简体   繁体   中英

How does classic ASP fit into the ASP.NET life cycle in integrated mode?

I have a web site that contains both ASP.NET and classic ASP pages. In addition, it has some .NET modules that attach to the BeginRequest, PreSendHeaders, and EndRequest events. These modules manipulate the site's cookies-- all of them, not just the ASP.NET cookies. As I understand it, in integrated pipeline mode, all HTTP requests go through the event life cycle, including classic ASP pages. The purpose of the module is to set the Path , HttpOnly , and other cookie attributes that are not supported by the classic ASP runtime.

How does the classic ASP rendering fit into the life cycle? Does it work just like a generic handler?

Specifically, when classic ASP renders the header for the ASP session cookie ( ASPSESSIONID , not ASP.NET_SessionId ), is it before or after EndRequest? I am not always seeing the event firing and sometimes the classic ASP session cookie isn't processed by my module.

Yes, Classic ASP is rendered via a generic handler, and the cookie should be accessible in the Http Module; I've had to work this too.

Classic ASP can set the path and http only attributes if you use the AddHeader method and shortcut the cookie content:

Response.AddHeader "Set-Cookie", "Name=value; path=/PathName; HttpOnly"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM