Add documentation for state table.
Fix bug in session hash calculation.