Encrypt the session id before writing to tracking logs.

Implements task AN-1102 of story AN-1077.

@mulby @cpennington @e0d please review.

Give the timings, I'm fine with not caching. :+1: