front_end.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:aniping 作者: kuruoujou 项目源码 文件源码
def set_login_id(self):
        """Session id Creator

        Creates a session id and writes it to the database.

        Returns:
            str. The id of the session.
        """
        _logger.debug("Setting login token.")
        session_id = hashlib.sha256(str.encode(str(time.time()))).hexdigest()
        _logger.debug("Exipres in 2 hours")
        expiry = int(time.time()) + 7200 #All cookies expire in 2 hours
        _logger.debug("calling DB to add login token to database")
        self.db("add_login_id", session_id, expiry)
        _logger.debug("Session ID is {0}".format(session_id))
        return session_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号