A
A
Asprod2021-08-05 22:51:26
Flask
Asprod, 2021-08-05 22:51:26

How to make different sessions?

I can't understand the title of the question, but I'll explain to you what and how. I want to create two different session types, one for users and one for admin. And all of them for convenience in one authorization page. I also made the 'role' field in sqlite in the table for users in order to determine it. Tried to do it through cookies but it didn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom, 2021-08-06
@Asprod

Sessions are encrypted, so you don't have to worry about someone suddenly stealing data, so you can add the same 'role' field to the session too (for both users and admins, and the rest of the dictionary can be completely different) and just check , who is in front of you: the user or "god" and perform some actions depending on this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question