Session expiration

Hi,

is there a way to check if the user is still connected or if the session has expired ?

Thank you by advance.