'get session record, or return the standard Guest Record'

def get_session_record(self):

    from frappe.auth import clear_cookies
    r = self.get_session_data()
    if (not r):
        frappe.response[u'session_expired'] = 1
        clear_cookies()
        self.sid = u'Guest'
        r = self.get_session_data()
    return r
