How to set all the cookie variables in a page to HTTPOnly in ASP?
标签:
asp-classic
相关问题
- If condition not working in classic ASP
- IE8 Form Not Submitting (Intermittent)
- Server.Transfer from ASP to ASP.Net
- Classic Asp date comparison not working correctly
- Using asp objects in .NET - Max compatibility
相关文章
- Can a VBScript function return a dictionary?
- ZURB Foundation, switching tab programmatically
- Accessing COM Component from Classic ASP which con
- Classic ASP/VBScript implementation of Crockford
- Caching recordsets in ASP Classic?
- Classic ASP - how to save data to CSV file with UT
- Handling hashed passwords stored as varbinary in S
- Classic ASP #include virtual not working
I'm afraid using the Response.Cookies collection will not work when setting HttpOnly (it's been driving me slowly mad!). As vbscript (well at least on the server i'm testing on) will character encode the semicolon.
Instead, add the header manually yourself, for example:
There is a similar post on stackoverflow called: How exactly do you configure httpOnly Cookies in ASP Classic?
I compiled the Microsoft's ISAPI filter example (http://msdn.microsoft.com/en-us/library/ms972826). This solved my problem.
The ISAPI DLL is here https://www.dropbox.com/s/e5mq749acms0rhx/HTTPOnly.dll?dl=0
Feel free to download.
Ancient question, but I had to figure it out for a legacy app myself.
Classic ASP's
Response.Cookies
collection just won't do the trick for adding theHttpOnly
tag. You need to useto get this to work. If you try to set the Path attribute of an item in the
Response.Cookies
collection like thisit helpfully URLEncodes the semicolon, thus corrupting the path.
So, I banged out a couple of classic asp functions for the purpose, offered here in solidarity with everybody living with classic asp.
To use this, call it like this
(Classic ASP is like disco. A generation later, it still sucks.)