A session data struct with an encode method and decode constructor