I'm setting up a polling system where users can vote once an hour. I'm using the code setcookie("voted", "1", time()+3600) to set a cookie for one hour. Everything seemed to be fine until I tested the page on an old PC where the time has sped up over time. The PC is at least an hour fast, and the cookie would never set. After searching online, I found some solutions online talking about server time as opposed to browser time. When I changed the clock to the correct time, the cookie sets perfectly. I also tested this out on my Mac with the same results in 3 different browsers. Will this be a problem for users in different time zones? If so, how can I fix this issue? Thanks.
I'm setting up a polling system where users can vote once an hour. I'm using the code setcookie("voted", "1", time()+3600) to set a cookie for one hour. Everything seemed to be fine until I tested the page on an old PC where the time has sped up over time. The PC is at least an hour fast, and the cookie would never set. After searching online, I found some solutions online talking about server time as opposed to browser time. When I changed the clock to the correct time, the cookie sets perfectly. I also tested this out on my Mac with the same results in 3 different browsers. Will this be a problem for users in different time zones? If so, how can I fix this issue? Thanks.
Update: After clearing cookies on all browsers, the problem only seems to remain in Internet Explorer. Is this a known issue in IE? Is there a workaround for this?
I'm setting up a polling system where users can vote once an hour. I'm using the code setcookie("voted", "1", time()+3600) to set a cookie for one hour. Everything seemed to be fine until I tested the page on an old PC where the time has sped up over time. The PC is at least an hour fast, and the cookie would never set. After searching online, I found some solutions online talking about server time as opposed to browser time. When I changed the clock to the correct time, the cookie sets perfectly. I also tested this out on my Mac with the same results in 3 different browsers. Will this be a problem for users in different time zones? If so, how can I fix this issue? Thanks.
Update: After clearing cookies on all browsers, the problem only seems to remain in Internet Explorer. Is this a known issue in IE? Is there a workaround for this?