正在加载视频...

视频加载失败

New in Astro 5.7, the Sessions API lets you store user data securely on the server, without the limitations of cookies. Great for shopping carts, user settings, form state, and lots more.

11,146 次观看 • 1 年前 •via X (Twitter)

8 条评论

Astro 的头像
Astro1 年前

Type-safe, and as easy to use as get() and set(). Store large, complex objects. Everything is stored on the server, avoiding user tampering. Session cookies are handled automatically, or go cookieless and handle the IDs yourself.

Astro 的头像
Astro1 年前

Session storage is zero-config on Node.js and Netlify, almost-zero on Cloudflare and Vercel, or choose from loads of built-in storage drivers, including Redis and SQL. The Astro Sessions API is easy out of the box, and as customizable as you need.

rootkid ✌️ 的头像
rootkid ✌️1 年前

Fascinating how the 90s web stuff rediscovered today

Astro 的头像
Astro1 年前

Respect the OG

Eris 的头像
Eris1 年前

Sessions is really, really great addition. BUT, There is a HUGE problem with cloudflare deployments They force the trailing slash on all pages - and it clashes with astro config Many people don’t even know about this issue, and it breaks down the whole website’s SEO if not configured correctly - duplicate pages, nobody thinks to set the correct cannonicals depending on their slash config in astro, and redirects are not ideal for SEO without the correct canonicals. Also if somebody has no slash links all over their site, and they are deployed on cloudflare - they effectively redirect the client on every navigation without even knowing

rootkid ✌️ 的头像
rootkid ✌️1 年前

@astrodotbuild Wouldn't it be sufficient to set trailingSlash to "always" when you're hosting with Cloudflare?

tommy george 的头像
tommy george1 年前

This is my kinda web dev.

RTTS 的头像
RTTS1 年前

API testing of interfaces is critical to determine if they meet requirements for functionality, reliability, performance, and security. Check out RTTS - the automated testing experts since 1996. #API #testautomation #integrationtest

相关视频

JWT in 60 Seconds 👇 What is JWT ? JWT = JSON Web Token A compact, URL-safe token used for: - Authentication - Authorization - Secure API communication - Identity sharing between services It is digitally signed, so it can be verified and trusted. 🟢 Why JWT exists Typical flow without JWT: User → Application → Database (Session Store) - Server stores sessions - Requires memory/storage - Hard to scale in microservices - More infrastructure complexity - Needs sticky sessions behind Load Balancer - This doesn’t scale well in distributed systems. 🟢 JWT comes into the picture - JWT is stateless authentication. New flow: User → Application → JWT → Client → API - No session stored on server - Token carries user identity & claims - Server only verifies signature - Perfect for scalable systems. 🟢 Complete JWT request flow 1️⃣ User logs in with credentials 2️⃣ Server validates user 3️⃣ Server generates JWT (Header + Payload + Signature) 4️⃣ Client stores JWT (usually in browser/app) 5️⃣ Client sends JWT in Authorization header 6️⃣ Server verifies signature 7️⃣ If valid → Access granted No database lookup for session needed. 🟢 Where JWT is used in real systems? - REST APIs - Microservices authentication - OAuth2 / SSO - API Gateways - Kubernetes dashboards - CI/CD tools - Mobile & SPA applications - Almost every modern cloud-native app uses JWT. 🟢 JWT in DevOps & System Design : As a DevOps engineer, JWT knowledge is used in: - Designing stateless applications - Scaling apps behind Load Balancers - Implementing API security - Working with IAM & OAuth providers - Securing microservices communication - Reducing session storage dependency Stateless auth = Better scalability + Simpler infrastructure Thanks for reading. Happy Learning !

Nandkishor

27,761 次观看 • 4 个月前