Next Question
RSS
http://classicasp.aspfaq.com/general/how-do-i-detect-enabled-cookies/javascript.html
Permalink | Report
Answered Question
M$1
June 16, 2009 08:55 PM
How do you access JavaScript cookies from ASP?
I am working on a site that was written in ASP (VBScript) and added a Javascript/CSS based "disclaimer" that i want to show up the first time site is loaded after logging in.
The way the script works is that if there is no cookie named "droppedin" then it sets one and displays the disclaimer as an animated/fly-in window.
I want the logout page (logout.asp) to clear this cookie. I have tried the following:
Response.Buffer = true
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
Server.ScriptTimeout = 60
Session("uid") = ""
Session("pass") = ""
Session("group") = ""
Session("shift") = ""
Session("UserAuth") = ""
Session("UserAdmin") = ""
Response.Cookies("droppedin") = ""
Response.Redirect("login.asp")
This does not clear the cookie. Using TamperData in Firefox, the cookie values show as follows (note 2 droppedin cookies):
Cookie=droppedin=yes; droppedin=; ASPSESSIONIDCCACSRDS=GDNPECNDBANFJKFAAOLOMMDI
How can I access a cookie set by JavaScript and re-set it from ASP/VBScript?
The way the script works is that if there is no cookie named "droppedin" then it sets one and displays the disclaimer as an animated/fly-in window.
I want the logout page (logout.asp) to clear this cookie. I have tried the following:
Response.Buffer = true
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
Server.ScriptTimeout = 60
Session("uid") = ""
Session("pass") = ""
Session("group") = ""
Session("shift") = ""
Session("UserAuth") = ""
Session("UserAdmin") = ""
Response.Cookies("droppedin") = ""
Response.Redirect("login.asp")
This does not clear the cookie. Using TamperData in Firefox, the cookie values show as follows (note 2 droppedin cookies):
Cookie=droppedin=yes; droppedin=; ASPSESSIONIDCCACSRDS=GDNPECNDBANFJKFAAOLOMMDI
How can I access a cookie set by JavaScript and re-set it from ASP/VBScript?
Interesting Question?
Yes ()
No ()
- In Technology & Internet |
- Tags: development, web, cookies, asp, javascript |
- |
- Report |
-
Share
RSS
Other Answers (1)
June 24, 2009 03:10 PM
Look this.. http://classicasp.aspfaq.com/general/how-do-i-detect-enabled-cookies/javascript.html
Permalink | Report
June 25, 2009 02:38 AM
This introduces a possible workaround, by passing the Javascript and ASP calls back and forth through page requests. Not the best solution, but the best so far. If Mahalo didn't give the other response Best Answer already, I'd give it to you as the other response suffers the same issue I've been having
Report
Answer this Question
Related Questions
Ask a Question
Buy Mahalo Dollars with Credit Card or PayPal
Top Members
Most Popular Tags
Categories
- Anonymous
- Arts & Design
- Beauty & Style
- Books & Authors
- Business
- Cars & Transportation
- Consumer Electronics
- Coupons Deals
- Education
- Entertainment
- Environment
- Fitness
- Food & Drink
- From Email
- From Iphone
- From Twitter
- Health
- History
- Hobbies
- Home & Garden
- How Tos
- Humor
- Jobs
- Legal
- Local
- Love & Relationships
- Mahalo Answers Community
- Money
- Music
- News
- NSFW
- Parenting
- Pets
- Science & Mathematics
- Services
- Shopping
- Social Science
- Society & Culture
- Sports
- Technology & Internet
- Travel
- Video Games
Welcome New Members
- jagb23, November 30, 2009 04:52 AM
- barbarabasinger, November 30, 2009 04:49 AM
- elizabethjenkin..., November 30, 2009 04:42 AM
- thien04an, November 30, 2009 04:04 AM
- sarrafica, November 30, 2009 03:50 AM
Mahalo Dollars are the currency of Mahalo Answers.
Each Mahalo Dollar costs $1.
Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More
That would expire the "ASP" cookie, but not the JavaScript cookie.