Made the logout behaviour more sensible, will only do it for logged in users and invalidate session
PMCP-9 #Done Logout will now invalidate sessions and won't work for users not logged in