I have stored the userid into a flask session. But when another user opens the browser and sets the session userid. My current session userid changes. Is it possible. I am also using a global class variable which gets initiated from the session as below. Because of this all process gets messed up when more than one user uses the url. I am running python flask using nohup
login @app.route('/mainlogin',methods = ['GET','POST']) def login(): try: if request.method =='POST': session['uid'] = request.form['db_user'] main @app.route('/main',methods = ['GET','POST']) def mainindex(): global clsmain uid=session.get('uid') clsmain=clsmain(uid) @app.route('/viewlog',methods = ['GET','POST']) def viewlog(): return render_template('log.html',status="<br>" + clsmain.readlog()) Why does session overwrites. Or is it global variable acting as the same value across sessions?
clsmainis I can't say, but something about it smells fishy to me.