Session handling and detection.