如何防止我的网站内容在用户注销后显示,并且没有适当的身份验证?

问题描述 投票:0回答:0

当用户注销时,某个页面被重定向,当我使用浏览器的后退按钮时,可以看到内容。为什么会这样?

@admins.route("/logout")

def logout():
    logout_user()
    session.clear()
    response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
    response.headers['Pragma'] = 'no-cache'
    response.headers['Expires'] = '0'
    return redirect(url_for('main.index'))

flask flask-login
© www.soinside.com 2019 - 2024. All rights reserved.