0

Is it possible to check when the cookie file was created using a web based language like PHP or JS? Would this be useful in determining if a cookie has been copied from the original device it was set on to a new device?

Edit to clarify: I'm not asking about the cookie expiration date, I'm asking about the date the cookie file was created on the client device. For example in Windows OS a user can right click on a file and view properties such as Date Created.

For the purpose of user authentication via cookies, if the cookie uuid and the Date Created are both stored in a database and both verified later would this prevent the scenario where a third party intercepts the cookie and creates a copy on their own machine to impersonate another user? The Date Created would not be the same on the second machine even if the contents of the cookie are the same. Is this applicable/useful or unnecessary?

Derek Roberts
  • 31
  • 1
  • 8
  • Possible duplicate of [Reading cookie expiration date](https://stackoverflow.com/questions/1532193/reading-cookie-expiration-date) – Russ J Mar 13 '19 at 18:54
  • 1
    no it is not by default, check this [question](https://stackoverflow.com/questions/17722084/how-to-read-the-cookie-creation-date-not-expiration) – ilia Mar 13 '19 at 18:55
  • Yes I think Jake has provided a link to an answer. – Derek Roberts Mar 13 '19 at 19:01
  • 1
    The cookie file contains ALL cookies. It gets created the first time the user goes to any web site that sets a cookie, and gets updated as cookies change. Why would the initial creation date be interesting? – Barmar Mar 13 '19 at 19:50
  • Are you really asking about the cookie file, or about the creation time of a specific cookie? – Barmar Mar 13 '19 at 19:50
  • It sounds like you think there's a separate file for each cookie. – Barmar Mar 13 '19 at 19:53
  • 1
    There's no way for the server to find out the cookie creation date. If someone can copy another user's cookies, they can impersonate them. – Barmar Mar 13 '19 at 19:54
  • Thanks for clarifying several points @Barmar, much appreciated. – Derek Roberts Mar 13 '19 at 23:36

0 Answers0