thanks for the code vickey,
but this code gives the current user right.
but i want to capture user log out event, while logging out i want to capture that session id and insert it into database.
i want to know whether the user logged out from site or not.
while logging out, the session id will time out right. so i need to check whether the user has logged out or not.