1

I want to read the sessionid in cookie which is automatically generated by asp.net. such as ASP.NET_SessionId. but when i use javascript: document.cookie = "ASP.NET_SessionId=;" since i want to set the ASP.NET_SessionId to be empty.

but after the javascript executed, i found instead of change the ASP.NET_SessionId to empty, system generate a new cookie with ASP.NET_SessionId equal to empty.

why system not modify the cookie but generate a new one ?

Thanks!

1

1 Answer 1

0

Don't try to re-use the cookie - write your own cookie. The behaviour you are seeing is that when you destroy the cookie, the ASP.NET process creates it again. If you make it blank, it just re-instates it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.