Giter Club home page Giter Club logo

Comments (2)

mark-bradshaw avatar mark-bradshaw commented on August 15, 2024

Hi @kfir124

  1. Yar and auth-cookie are parallel projects, but not connected in any way. I'm not intimately familiar with AC, but I'll give this question a shot. Yar is simpler to use IMO. AC has additional complexities. Auth-cookie, as the name suggests, ties into the authentication layer of Hapi and so requires a user be logged in to use it. Yar has no such requirements. Sessions are independent of logins. Another difference, as I understand it, is in storage size. Yar handles arbitrary length data sizes but automatically dropping data into the hapi cache layer if necessary, though it tries to use cookies where it can. AC can use a cache fallback, but you have to handle that manually. I'd suggest just looking over the docs for both and seeing which seems to appeal more.
  2. When the user logs out use yar.reset() to clear out the session.
  3. That's trickier. I'm afraid there's no direct way to target a specific session of another browser/user. You'll need to write some code to check for invalidated sessions and clear them, or double check admin permissions instead of relying on the session to grant access. Something like that.

Using yar with redis is very common. Just setup redis as your hapi caching layer (https://github.com/hapijs/catbox-redis) and you're all good. Yar will do the rest.

The session id is kept in the cookie, and the cookie is always encrypted.

from yar.

lock avatar lock commented on August 15, 2024

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

from yar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.