Board index » Web Programming » How to clear cookies in ASP?
|
Uchytilian
|
How to clear cookies in ASP?
Web Programming72
Hi, I have a website that would set two cookies when a user logs in successfully. <% response.cookies("login_status")="OK" response.cookies("login_id")="12345" 'This value is from database. response.cookies("login_id").domain="mysitexyz.com" %> and I have a question in "removing/deleting/cleaning the cookie when the user logs out. From my understanding there are two methods - #1 (I am currently using) response.cookies("login_status")="" response.cookies("login_id")="" #2 response.cookies("login_status").expires=now response.cookies("login_id").expires=now My questions is, what's the difference, advantage and disadvantage of these two methods? I am asking this because I have noticed that there are some problems in #1. In my computer (I use IE7) if I login as one user, logout, and then login as another user, the cookie value will get mixed up. Somehow the response.cookies("login_status") can display correctly but response.cookies("login_id") cannot. But if I clean my browser cache, close my IE and reopen it, both cookies work fine. Anyone has ideas or suggestions will be highly appreciated. - |
