util.gettimeofday() returns values too large for string.format("%d")

Fix bug in getting and setting secure cookies by using tostring() to
convert the number of miliseconds since the epoch to a string.