Skip to content

Instantly share code, notes, and snippets.

@agustinhaller
agustinhaller / gist:df8e7680058eb1b31cbe
Created October 2, 2015 17:39 — forked from ghinda/gist:6036998
local/session storage polyfill (@Rem's version + with support for opera mini)
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();