From 78eabd8d58f180e16a656c69fac0124c03bddd63 Mon Sep 17 00:00:00 2001 From: dharaneesh-r Date: Wed, 1 Jul 2026 16:26:22 +0530 Subject: [PATCH] updates on the session cache --- src/App.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/App.js b/src/App.js index 4060eb1..125565a 100644 --- a/src/App.js +++ b/src/App.js @@ -16,6 +16,8 @@ import { useDispatch, useSelector } from 'react-redux'; // ==============================|| APP - THEME, ROUTER, LOCAL ||============================== // +const SESSION_CLEAR_INTERVAL_MS = 30 * 60 * 1000; + const App = () => { let navigate = useNavigate(); useEffect(() => { @@ -23,6 +25,14 @@ const App = () => { navigate('/login'); } }, []); + + useEffect(() => { + const timer = setInterval(() => { + localStorage.clear(); + navigate('/login'); + }, SESSION_CLEAR_INTERVAL_MS); + return () => clearInterval(timer); + }, []); const { openItem } = useSelector((state) => state.menu); console.log('openItem', openItem);