Changed http.cookie_set to use seconds instead of hours for expiry
Changed math.rand to generate a random integer based on range instead of
size