Is it necessary to call session_start() for unauthenticated users on a PHP website?

It is not necessary to call session_start() for unauthenticated users on a PHP website as it unnecessarily starts a session for every visitor, which can impact performance. Instead, session_start() should only be called when a user is authenticated and needs to store session data.

// Check if user is authenticated before calling session_start()
if($user_authenticated) {
    session_start();
    // Additional session handling code here
}