Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:57:15+00:00 2026-06-17T07:57:15+00:00

I apologize for not having any initial code to support this question I have

  • 0

I apologize for not having any initial code to support this question

I have authlogic set up to logged_in_timeout after 20 minutes. What I would like to do is build a jQuery function that will pull in the ‘last_request_at’ value from my users model and then run a timer that will alert the use at 18 minutes “You are about the be logged out”.

Can jQuery pull directly from the DB, or should I pass a session to the function?

Then, I would like to have two buttons in the model/alert “Log Me Out” or “Stay Logged In”.

 If the user clicks "Stay Logged In" how would I have jQuery update the last_request_at field in the DB? 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:57:16+00:00Added an answer on June 17, 2026 at 7:57 am

    I just used coffeescript to make this work.

       setTimeout (->
        setTimeout (->
          parent.location.reload true
        ), 70000
     $('#inactivity_modal').modal()
       $("#inactivity_modal").bind "hidden", ->
       parent.location.reload true
       ), 540000
    

    In my app a user is automatically logged out at 10 minutes since last request. So, at 9 minutes (54000 milliseconds) this function activates a modal that includes two buttons; one to log out and one to stay logged in. The stay logged in button simply closes the modal and refreshes the parent thereby updating Authlogics last_request_at field and giving the user another 9 minutes until it happens again. Of course, any time a page loads the timer gets reset, therefor any active user wont see the modal. If the user does not respond to the warning modal, Authlogic ends their session one minute later (at 10 minutes) and 10 seconds after that (70000) the parent page is refreshed to conceal any content that may have been visible on the previous page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, I have to apologize for not having a better title. Feel
I apologize in advance for not knowing how to better state this question. In
I apologize for the newb question but have not found a solution online. I
I apologize for making my first question not the hard-hitting code-related question I was
I apologize if this question is a bit broad, but I'm having a difficult
I apologize in advance for this question. I don't like explain this code questions,
First and foremost, I apologize for any vagueness in this question. At this point,
I am not very familiar with Hibernate Criteria, and apologize if this question is
This is a slightly abstract question, for which I apologize. I am not necessarily
I apologize if this has already been asked - I'm not certain of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.