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 -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -