For PHP technique, it has a problem. The time() gets the time of the server instead of the browser. In order to get the accurate expiration timing, one needs to either rely on Javascript to set the cookie or obtain the time zone from the browser as I mentioned in my earlier post.