I have a little API I’m building.
The user can “share” an object using the api, but I want to limit the user to share an object only once in 24 hours. for example, I have 5 objects. the user can share every object, but only after 24 hours, he can share the specific object again.
P.S: every object has an ID.
thanks
Save a time() value when they start, then compare it to the current time() value every time its accessed. if the difference is greater than 60*60*24 then you know 24 hours has elapsed.