How can the var_dump function be used to debug SESSION variables in PHP?

When debugging SESSION variables in PHP, the var_dump function can be used to display the contents of the SESSION array. This can help identify any issues with the data stored in the SESSION variables and aid in troubleshooting. By using var_dump, you can easily see the structure and values of the SESSION variables.

// Display the contents of the SESSION array using var_dump
var_dump($_SESSION);