<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Js on Nick Spacek</title><link>https://spacek.ca/tags/js/</link><description>Recent content in Js on Nick Spacek</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 03 Dec 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://spacek.ca/tags/js/index.xml" rel="self" type="application/rss+xml"/><item><title>Remove JSESSION ID cookie</title><link>https://spacek.ca/2013/12/03/remove-jsession-id-cookie/</link><pubDate>Tue, 03 Dec 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/12/03/remove-jsession-id-cookie/</guid><description>&lt;p&gt;{% include JB/setup %}&lt;/p&gt;
&lt;p&gt;I made a simple little bookmarklet that will remove the JSESSIONID cookie (for
testing purposes). We are using it to test behavior of AJAX updates when the
session expires.&lt;/p&gt;
&lt;p&gt;Here it is, drag to your bookmarks: &lt;a href="javascript:!function(){function createCookie(name,value,days){if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3);var expires='; expires='+date.toGMTString()}else var expires='';document.cookie=name+'='+value+expires+'; path=/'}function readCookie(name){var nameEQ=name+'=';var ca=document.cookie.split(';');for(var i=0;i&amp;lt;ca.length;i++){var c=ca[i];while(' '==c.charAt(0))c=c.substring(1,c.length);if(0==c.indexOf(nameEQ))return c.substring(nameEQ.length,c.length)}return null}function eraseCookie(name){createCookie(name,'',-1)}var target='JSESSIONID';if(null==readCookie(target)){alert('No cookie named '+target+' found');return}if(confirm('Do you want to delete the cookie named '+target+'?'))eraseCookie(target)}();"&gt;-JSESSIONID&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This makes use of &lt;a href="http://www.quirksmode.org/js/cookies.html"&gt;Peter-Paul Koch&amp;rsquo;s code from quirksmode.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>