'Get session the expiry date (as a datetime object).'

def get_expiry_date(self):

    expiry = self.get('_session_expiry')
    if isinstance(expiry, datetime):
        return expiry
    if (not expiry):
        expiry = settings.SESSION_COOKIE_AGE
    return (datetime.now() + timedelta(seconds=expiry))
