Skip to content
← Back to Community
Help with Flask Login and Usernames
Profile icon
MathBoy1

So basically, when a user logs onto my flask site and another user logs on too, it shows both the users the same page as the most recent user to login... I tried adding sessions to vital pages to fix this issue, but I've had no luck yet... I was hoping if someone could help me fix it...

Maybe we could contact through Discord (since its a bit more convenient)? My username is ElectroWiz#5313.

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
Profile icon
MathBoy1
Comments
hotnewtop
Profile icon
VulcanWM

Try adding flask.session like on the functions.py file in here: https://replit.com/@VulcanWM/OvalEyes

Profile icon
MathBoy1

@VulcanWM I tried using the same but it didnt work...

Profile icon
VulcanWM

well ive been using it for at least 7 of my projects and its works fine, can you give me a link to your repl? @MathBoy1

Profile icon
MathBoy1

@VulcanWM sure, Could I have your discord?

Profile icon
VulcanWM

I don’t have it, you can email me: [email protected] @MathBoy1

Profile icon
MathBoy1

@VulcanWM I shared the repl... Please help me!

Profile icon
VulcanWM

i tried my best but it didnt work, i have the same code in my repl but it works so maybe its the repl's problem or maybe it being a private repl? can you try forking the repl and then seeing if it works? @MathBoy1

Profile icon
MathBoy1

@VulcanWM I tried doing that too, but it didn't work...

Profile icon
MathBoy1

@VulcanWM I was able to fix it, thanks!

Profile icon
VulcanWM

Nice! How did you do it? @MathBoy1

Profile icon
MathBoy1

@VulcanWM Instead of using addcookie(), removecookie() and getcookie(), I used username = session["Username"] on all pages except for login. On the login page i used session["Username"] = username.

Profile icon
VulcanWM

Ah smart, glad that’s fixed! @MathBoy1

Profile icon
Korbindev

I cant see it I rlly need a [email protected]

Profile icon
VulcanWM

Look at functions.py @Korbindev

Profile icon
Korbindev
Profile icon
MathBoy1

btw, im using replDB for user accounts