javascript - Remove Cookies In Jquery on logout button -



javascript - Remove Cookies In Jquery on logout button -

hi trying create code clear cookies in jquery onclick of logout button didn't solution

function logout() { document.cookie = 'visit=; expires='+new date(0).toutcstring() +'; path=/finalvertozz/'; window.location='../login.html'; }

cookies details

name: visit content: 09850227123455130 domain: localhost path: /finalvertozz send for: kind of connection accessible script: yes created: saturday, oct 4, 2014 11:25:45 expires: when browsing session ends

from reference of question , reply @russ cam how set/unset cookie jquery? utilize function reuse

function createcookie(name, value, days) { var expires; if (days) { var date = new date(); date.settime(date.gettime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.togmtstring(); } else { expires = ""; } document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/"; } function readcookie(name) { var nameeq = escape(name) + "="; var ca = document.cookie.split(';'); (var = 0; < ca.length; i++) { var c = ca[i]; while (c.charat(0) === ' ') c = c.substring(1, c.length); if (c.indexof(nameeq) === 0) homecoming unescape(c.substring(nameeq.length, c.length)); } homecoming null; } function erasecookie(name) { createcookie(name, "", -1); }

hope may help :)

javascript jquery cookies

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -