问题描述
我使用烧瓶:
from flask import Flask,render_template,session
class Session:
def __init__(self):
self.ip = request.remote_addr
self.name = request.remote_user
session['ip'] = self.ip
session['name'] = self.name
@app.route('/',methods=['GET'],strict_slashes=False)
def indexpage():
return render_template('index.html',s=Session())
但是,不同的设备获得相同的输出,这意味着 Session.ip
和 Session.name
来自不同的设备是相同的。我认为类 Session
未正确初始化。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)