I have a website that needs to perform a certain backend function once per user session. I therefore want to be able to determine whether any given page view is the first within a given session.
According to the PHP docs:
session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.
So is there any way to know whether the session is being created or resumed?
Or is this a situation where I have to check the current session ID against a list I maintain on the server, to check if it's been registered before? If so, does this necessitate writing to a database, or is there a less cumbersome, in-memory way of doing this?