name = 'John Doe'; $person->age = 30; $_SESSION['person'] = $person; ?>This code creates a new session and writes an object "person" with two properties to the session. Package library: The PHP session write function is part of the PHP core library. No external package library is required to use this function.