Help with Flask Login and Usernames
h
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.

You are viewing a single comment. View All
VulcanWM

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

MathBoy1

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

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

MathBoy1

@VulcanWM sure, Could I have your discord?

VulcanWM

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

MathBoy1

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

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

MathBoy1

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

MathBoy1

@VulcanWM I was able to fix it, thanks!

VulcanWM

Nice! How did you do it? @MathBoy1

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.

VulcanWM

Ah smart, glad that’s fixed! @MathBoy1