'Removes the authenticated user\'s cookies and session object.
Causes the authenticated user to be logged out.'

def logout(self):

    session = import_module(settings.SESSION_ENGINE).SessionStore()
    session_cookie = self.cookies.get(settings.SESSION_COOKIE_NAME)
    if session_cookie:
        session.delete(session_key=session_cookie.value)
    self.cookies = SimpleCookie()
