0
Hello, I am developing a project to study character and I am with a great inconvenience.
I’m using:
- astroid==2.0.4
- Bottle==0.12.13
- canister==1.5.1
- Colorama==0.4.0
- cymysql==0.9.12
- Cython==0.29
- isort==4.3.4
- Lazy-Object-proxy==1.3.1
- Mccabe==0.6.1
- Pyjwt==1.6.4
- pylint==2.1.1
- Six==1.11.0
- wrapt==1.10.11
As you can see I use canister to create and maintain my sessions, the problem I face is the following, when entering login and password, perform existence confirmation and data confirmation in the database and start a session, if I access mine using the (ip of my computer):8080 it does not take me to the home screen, does not take me to the login screen, takes me to my Dashboard, as if I had already logged on to that device, I thought maybe it could be problem with my network or something, this way I stayed in the pythonanywhere and continued with same problem.
from bottle import Bottle, TEMPLATE_PATH
from Data.SQL import MySQL
import os
import canister
from canister import session
# Diretorio base.
base_path = os.getcwd().replace('\\', '/')
# Instancia da aplicacao.
app = Bottle()
# Path de configuracao.
app.config.load_config('{}/config/lobster.config'.format(base_path))
# Instalacao do plugin de sessoes.
app.install(canister.Canister())
# Instancia do banco de dados.
banco_mysql = MySQL()
from app.Controllers import *
When the query is performed and the data is validated the following methods are executed creating both the sessions and the cookies
def definir_cookie_login(self, usuario_id, nome, email, na, unidade):
response.set_cookie('usuario_id', str(usuario_id))
response.set_cookie('nome_usuario', str(nome))
response.set_cookie('email', str(email))
response.set_cookie('na', str(na))
response.set_cookie('unidade', str(unidade))
def iniciar_sessao(self, usuario_id, nome, email, na, unidade):
session.data['usuario_id'] = str(usuario_id)
session.data['nome_usuario'] = str(nome)
session.data['email'] = str(email)
session.data['na'] = str(na)
session.data['unidade'] = str(unidade)
Anybody got any ideas? how can I make it so that every attempt to access a different device or even a different browser is created a new session instead of accessing the one already used.