Handle session state