Add session end handling for post and thread creation