Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
idle-session-timeout
Advanced tools
Idle session timeout is a security and resource management feature that automatically logs a user out after a period of inactivity
Idle session timeout is a security and resource management feature that automatically logs a user out after a period of inactivity.
npm i idle-session-timeout
import { IdleSessionTimeout } from "idle-session-timeout";
//time out in 5 min on inactivity
let session = new IdleSessionTimeout(5 * 60 * 1000);
session.onTimeOut = () => {
// here you can call your server to log out the user
console.log("timeOut");
};
//optional
session.onTimeLeftChange = (timeLeft) => {
// this will notify you each second about the time left before the timeout
console.log(`${timeLeft} ms left`);
};
session.start();
// can be manually reset.
session.reset();
// Note:when the session is expired, it's automatically disposed.
// To reset the counter for expired session use start method.
// to dispose the session
session.dispose();
// returns time left before time out
let timeLeft = session.getTimeLeft();
By default the counter is automatically reset on those events:
if for some reason you want to chose the events for the reset you can use
import { IdleSessionTimeout } from "idle-session-timeout";
//time out in 5 min on inactivity
let session = new IdleSessionTimeout(5 * 60 * 1000, "click", "mousemove", ... etc );
FAQs
Idle session timeout is a security and resource management feature that automatically logs a user out after a period of inactivity
We found that idle-session-timeout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.