Might be nice to have a comment here saying that expirationSetting is a number of minutes and we need to convert it to milliseconds. Would be helpful for slow people like me (took me a while :P)