DEV Community

Sean Brunnock
Sean Brunnock

Posted on • Edited on

1 1

Baby steps

So, in my quest to switch from LAMP to PERN, I'm going to update my old MySQL DB manager and turn it into a modern Postgres DB manager. This time, I'm going to use modern authentication techniques rather than my old basic HTTP authentication.

So, how do we do this? The Passport library seems to be the most popular. Great, let's use that. Passport uses sessions. Which library should I use? The Express team maintains express-session and cookie-session. Cookie-session looks simpler. Let's use that. Nope. It's not compatible with Passport currently.

Fine, we'll use express-session. express-session creates a session id and stores it in a cookie. How do I manipulate cookies in JS? I have to use something called encodeURIComponent. I've never used it. How does it differ from encodeURI? Time to do some research.

OK. I've updated my encodeURI demo so it now includes examples of encodeURIComponent and decodeURIComponent. That'll do for today.

Baby steps.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Image of Timescale

📊 Benchmarking Databases for Real-Time Analytics Applications

Benchmarking Timescale, Clickhouse, Postgres, MySQL, MongoDB, and DuckDB for real-time analytics. Introducing RTABench 🚀

Read full post →

👋 Kindness is contagious

Please show some love ❤️ or share a kind word in the comments if you found this useful!

Got it!