ISAPI不能共享ASP的Session

MSDN中說的,鬱悶,不知道有沒有什麼其他辦法,難道真的用Cookie

INFO: ASP Session Object Can't be Accessed by ISAPI DLLs

SUMMARY

ISAPI filters and extensions do not have access to ASP intrinsic objects. This includes the ASP session object.

MORE INFORMATION

The ASP intrinsic objects, including the session object, are instantiated when Asp.dll processes an ASP page. When ISAPI filters and extensions run, the intrinsic objects for a given session do not exist. For this reason, it is not possible for an ISAPI DLL to access information stored in a session object.

If it is desirable to share information between ASP and ISAPI, and numerous techniques may be used to do so. The best mechanism for sharing data may be through the use of cookies. ASP can set and retrieve cookies as follows:
<% Response.Cookies("VisitorID") = 49 %>
<%= Request.Cookies("VisitorID") %>
    
This can also be accomplished in an ISAPI DLL as described in the following Microsoft Knowledge Base article:
168864 Implementing Cookies in ISAPI
It is also possible to share information between ASP and ISAPI by passing arguments along with the requested URL, resulting in a GET request:
http://server/vdir/some.asp?firstname=Robert&LastName=Duke
    
發佈了21 篇原創文章 · 獲贊 0 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章