dcsimg
How to delete cookies in JavaScript without expiring them?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rahul_Vaid
Posted On:   Friday, June 20, 2003 02:03 AM

Hi, I have a requirement in my application to delete cookies from the browser.The search for the means to do it landed me to change the value of each cookie and not deleting them from the browser. It does not solve my purpose neways.I require to remove the existence of all cookies by name. Can any one share an idea? FYI,This is what works improperly !!! function delCookie(NameOfCookie) { document.cookie = NameOfCookie + "=" +null+"; expires=Thu, 01-Jan-70 00:00:01 GMT"; } function logout(){ if(confirm("Do    More>>

Hi,

I have a requirement in my application to delete

cookies from the browser.The search for the means

to do it landed me to change the value of each

cookie and not deleting them from the browser.

It does not solve my purpose neways.I require to

remove the existence of all cookies by name.

Can any one share an idea?


			
FYI,This is what works improperly !!!




function delCookie(NameOfCookie)

{
document.cookie = NameOfCookie + "=" +null+";

expires=Thu, 01-Jan-70 00:00:01 GMT";

}



function logout(){

if(confirm("Do you want to logout?")){

delCookie('Business');

delCookie('UserId');

delCookie('Security');

delCookie('Mode');

delCookie('SupplierKey');

window.close();

}

}

   <<Less

Re: How to delete cookies in JavaScript without expiring them?

Posted By:   Nitesh_Naveen  
Posted On:   Friday, June 20, 2003 02:51 AM

See this thread (click here)
About | Sitemap | Contact