Replace cookie with localStorage