之前,我對於沒有任何初始代碼來支持這個問題Authlogic jQuery的警報logged_in_timeout
我有authlogic設立了20分鐘後logged_in_timeout道歉。我想要做的是構建一個jQuery函數,它將從我的用戶模型中提取'last_request_at'值,然後運行一個計時器,在18分鐘時提醒用戶「您即將被註銷」。
Can jQuery pull directly from the DB, or should I pass a session to the function?
然後,我想在模型/警報「Log Me Out」或「Stay Logged In」中有兩個按鈕。
If the user clicks "Stay Logged In" how would I have jQuery update the last_request_at field in the DB?