check if access to localstorage is possible, if not fallback to cookie implementation