From the manual:
session_id() used to get or set the session identifier for the current session.
session_name() returns the name of the current session. If a name is specified, session_name() update the session name and return the name of the old session.
id used as the primary key (unique) for the database in which the sessions are stored (by default only in ondisk files), name is just a name. I am not sure that name should be unique. Thus, in this case, the code checks if session_id is (getting data from the browser cookie and searching in the local db) or if there is a cookie with the given name session_name. If so, it sets the cookie expiration time (client side) to 43.2 minutes ago and destroys the session (server side).
wkoot source share