What are some common pitfalls when using sessions in PHP, as seen in the provided code snippet?

One common pitfall when using sessions in PHP is not starting the session before attempting to access or modify session variables. This can lead to unexpected behavior or errors in the code. To solve this issue, it is important to always start the session at the beginning of the script using `session_start()`.

<?php
session_start();

// Access or modify session variables here
?>