localStorage + some bug fixes

added loadCookieToStorage for easily porting between version changes