I'm building a module and I want that module to know when an user visited a page.
When he visited the page less then x hours ago, an php action is skipt.
So I was thinking of two solutions :
- Using a cookie - Set a cookie with a date value and exparation periode and check the date value (this is the easy way)
- Register the user in a database with ip-address and timestamp. (A lot of programming)
What do you think is the best way to check to time an user was visiting a page.
Please your advise.