Added try/catch to avoid errors when cookies/storage is disabled