When a healthcare professional logs into a system, a session cookie is created to identify and authenticate the user. This cookie allows the professional to access different parts of the system without needing to re-enter login credentials. The session cookie is deleted once the user logs out or closes the browser, ensuring that no sensitive information is left behind.