Handle session and exceptions globally