Coder Social home page Coder Social logo

Comments (7)

vikramaggarwal13 avatar vikramaggarwal13 commented on August 18, 2024 1

@SankethBK Yes I have used below code to control my situation

final sessionConfig = SessionConfig(
        invalidateSessionForAppLostFocus: const Duration(minutes: 20),
        invalidateSessionForUserInactivity: const Duration(minutes: 20));
    final sessionConfig_new = SessionConfig(
        invalidateSessionForAppLostFocus: const Duration(minutes: 10),
        invalidateSessionForUserInactivity: const Duration(minutes: 10));

.................................................................
return SessionTimeoutManager(
      sessionConfig: sessionConfig_new,
      userActivityDebounceDuration: const Duration(seconds: 10),
      child: SessionTimeoutManager(
        sessionConfig: sessionConfig,
        userActivityDebounceDuration: const Duration(seconds: 10),
        child: GetMaterialApp(
..........................

Thanks above code solved my problem.

from local_session_timeout.

SankethBK avatar SankethBK commented on August 18, 2024

@vikramaggarwal13 this library only emits events. It's up to your application how you want to handle these events. In your case when a logout event is emitted, instead of actually logging out user you can display an alert to stay logged in.

from local_session_timeout.

vikramaggarwal13 avatar vikramaggarwal13 commented on August 18, 2024

@SankethBK Certainly. We have implemented an alert with two buttons, "Stay Signed In" and "Logout," which is displayed at the specified time. In the event that a user does not take any action on the alert, we are seeking a solution to automatically log them out after a few minutes using this plugin.

from local_session_timeout.

vikramaggarwal13 avatar vikramaggarwal13 commented on August 18, 2024

@SankethBK Can we have remaining time value in seconds ? as before 15 seconds of logout we want to show some alert.

from local_session_timeout.

SankethBK avatar SankethBK commented on August 18, 2024

yes, it takes a Duration object, you can pass Duration(seconds: 15)

from local_session_timeout.

vikramaggarwal13 avatar vikramaggarwal13 commented on August 18, 2024
 SessionConfig(
        invalidateSessionForAppLostFocus: const Duration(minutes: 10),
        invalidateSessionForUserInactivity: const Duration(minutes: 10))

I have passed 10 minutes . I want to show alert after 8 minutes and after 10 minutes logout.
I need to access remaining duration into some variable based on which i can put some condition to show alert.
If there is some quick communication mechanism then we can connect so that i can clear my doubt in once.

My mail id is [email protected]

from local_session_timeout.

SankethBK avatar SankethBK commented on August 18, 2024

Hi this can be solved by passing 8 minutes in SessionConfig

 SessionConfig(
        invalidateSessionForAppLostFocus: const Duration(minutes: 8),
        invalidateSessionForUserInactivity: const Duration(minutes: 8))

when you receive the logout event, instead of logging out start a new timer within your app for 2 minutes, after which you'll actually log out the user

from local_session_timeout.

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.