Now let’s put this into practice. Let’s say for example you wanted to set a cookie in a user’s browser to expire in one year. The way we would calculate this is by adding one year, or 31,536,000 seconds to the current date .