Brainstorming:
1) you keep last access time in session variable
a)In WebSocket_Connected, check last access time and if timed out, invalidate session and return to ./, otherwise update last access time to Now
b)In Page_ParseEvent, check last access time, invalidate session and return to ./, otherwise update last access time to Now
2) On top of that could also create a timer. This would allow you to proactively invalidate the session
a) In WebSocket_Connected, initialize timer
b) In Page_ParseEvent, reset timer
c) If timer executes, invalidate session and return to ./
Note: Make timer long enough in case page has some long running process it needs to complete
Note#2: The assumption for the above is that WebSocket_Connected and Page_ParseEvent are the only two entry points into your ABM Page. If any other entry points exists, they'll need to implement #1 and/or #2