Added ability to list states by session and user ids from MySQL database