Handling storage on client, cookie or localStorage