sessions

hi all,

in my application i have to maintain the user information in session and
updates the table flag when the user logins and while loggingout i
change the flag to zero.

i want to delete the stale sessions and while doing this i want to
perform operation on tables how to do this.

Please let me know

Regards,
Rajkumar.surabhi