Better session handling. New version.