Coder Social home page Coder Social logo

Comments (4)

moribvndvs avatar moribvndvs commented on August 19, 2024
  • The module does not consider $http activity to determine idleness. The goal of this module is to look for user input/interaction.
  • Yes, you can manually interrupt by injecting $idle (or Idle in the upcoming v1.0.0 release) and calling watch().

from ng-idle.

iyeldinov avatar iyeldinov commented on August 19, 2024

I meant that my session will expire if user didn't do anything that will trigger API calls. Did I understand correctly that Keepalive service can help me with this? And I was thinking of: If user will see modal and do any interaction to make an http call?

from ng-idle.

moribvndvs avatar moribvndvs commented on August 19, 2024

Oh, sorry. Yes. By default, the idle service will use keepalive. keepalive will ping every 10 minutes (by default, configurable) while the user is active. It will stop pinging once the user enters the idle state. When the user returns to the active state after going idle, keepalive will immediately ping, and then resume pinging as I previously described.

All you need to do is configure $keepaliveProvider.http() (or KeepaliveProvider.http() in v1.0.0) and it'll start sending HTTP requests for you using the options you specified. This works great for cookie-based session tokens because (in most cases) you just send a request to an HTTP endpoint and the browser will automatically include the session cookie for you. If that endpoint updates the session cookie and sends it back, the browser will take care of that for you, too.

However, if you need more control over sending and processing keepalive requests, you can leave http() option unset, listen for the $keepalive event (or KeepAlive in v1.0.0) and handle it yourself.

from ng-idle.

iyeldinov avatar iyeldinov commented on August 19, 2024

Thanks, now it is clear. When are you going to release v1.0.0?

from ng-idle.

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.