def METHOD_NAME(self):
    if not self.user:
        raise ValueError('Missed `user` property to use this method')
    session = Session.create_for_user(self.user)
    self.cookies["token"] = session.token
    self.cookies["token"]["expires"] = datetime.utcnow() + timedelta(days=30)
    self.cookies["token"]['httponly'] = True
    self.cookies["token"]['secure'] = True
    return self