Hello, I'm developing a project for the study character and I'm having a big problem.
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 confirmation of existence and confirmation of data in the database and start a session, if I access the my using my computer's ip: 8080 it does not take me to the home screen, it does not take me to the login screen, it takes me to my dashboard, as if I had already logged into that device, I thought maybe it could be a problem with my network or something, this way I hosted in pythonanywhere and continued with the 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 valid, the following methods are executed by creating both sessions and 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)
Does anyone have any ideas? how can I make each access attempt on a different device or even on a different browser to create a new session instead of accessing the one that is already being used.