paint-brush
How To Decode Django Sessions in PostgreSQLby@arctype
3,538 reads
3,538 reads

How To Decode Django Sessions in PostgreSQL

by Arctype6mMarch 20th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

How To Decode Django Sessions in Postgres is easy to do with Postgres. Django's default Django session backend stores persistent session data. The user_id is fetched from the decoded session data, the built-in User object is populated based on the stored data. Fortunately, we can easily base64 decode the data using Postgres' base64 encoding. We need to convert from binary data into text, using the "encode" function to extract all characters at the end of a string.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How To Decode Django Sessions in PostgreSQL
Arctype HackerNoon profile picture
Arctype

Arctype

@arctype

The collaborative SQL client for developers and teams

L O A D I N G
. . . comments & more!

About Author

Arctype HackerNoon profile picture
Arctype@arctype
The collaborative SQL client for developers and teams

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite