/ Published in: JavaScript
URL: http://dealis.pl/projects,cookie.html
Expand |
Embed | Plain Text
/* Author: Piotr Filipek Website: www.dealis.pl Version 0.1 E-mail: [email protected] */ var Cookie = { 'create':function(a1,a2,a3,a4){var c=typeof a4=='function'?a4:(new Function()),d,ex="";if(a3){d=new Date();d.setTime(d.getTime()+(a3*24*60*60*1000));ex="; expires="+d.toGMTString();c(a1,a2);};document.cookie = a1+"="+a2+ex+"; path=/";return this;}, 'read':function(a1){var c=typeof a4=='function'?a4:(new Function()),n=a1+"=",ca=document.cookie.split(';'),c;for(var i=0;i < ca.length;i++){c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(n) == 0)return c.substring(n.length,c.length);}}, 'delete':function(a1,a2){Cookie.create(a1,'',-1,a2);} };
You need to login to post a comment.
