Check if session exist when logging out.

issue3344
review1040002
(transplanted from 3686ae05928cf0f8526c9eca4a377f8758d4ce46)

--HG--
extra : transplant_source : 6%86%AE%05%92%8C%F0%F8Rl%9E%CAJ7%7F%87X%D4%CEF