c# - why not using Request.Cookies.Clear() in ASP.NET web forms? -


i searched here on stackoverflow removing cookies site, couldn't find single answer suggesting use of request.cookies.clear() method.

what's difference between:

if (request.cookies["usersettings"] != null) {     httpcookie mycookie = new httpcookie("usersettings");     mycookie.expires = datetime.now.adddays(-1d);     response.cookies.add(mycookie); } 

and:

request.cookies.clear(); 

thanks in advance! , sorry bad language, english not native!

calling remove or clear remove server side collection held request.cookies (which copy of cookies client sent you). not cause server instruct client browser remove cookie. need set timeout have indicated above (see msdn - how to: delete cookie official guidance).


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -