Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Pjura mpjura

  • Hearst Digital Media
  • NY
View GitHub Profile
@mpjura
mpjura / gist:3782195
Created Sep 25, 2012 — forked from remy/gist:350433
Storage polyfill
View gist:3782195
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();