Ensuring continuous session activity

While using the open office letter editing tool, users encounter a timeout issue where the application screen displays a timeout message.

Upon initial analysis, it appears that if users are working in the open office for longer than 60 minutes, the server does not refresh to extend the session even though the session remains active behind the scenes.

We currently have idle time settings configured in the web.xml file.

I am seeking assistance in resolving this issue and ensuring that the session remains alive.

Answer №1

In the past, I have implemented a clever solution to keep the server session alive. This involved setting a JavaScript timeout for a duration slightly shorter than the session timeout. When the timeout triggered, an ajax request was made to a server controller linked to the session. This action tricked the server into thinking the user was active and extended the session's lifespan.

It is important to note that upon receiving the ajax response, the JavaScript timeout needed to be reset to ensure the process continued smoothly.

Just a helpful tip: There is no need for any specific actions in the backend controller; it's simply a way of nudging the session to stay alive.

Answer №2

To set an indefinite session timeout in web.xml, replace 60 with -1 like this:

<session-config>
     <session-timeout>-1</session-timeout>
</session-config>

If you prefer not to extend the session time out, consider implementing a workaround:

Run your task in a separate thread that interacts with the session while processing or informs the user once the thread completes.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Show numbers in reverse order from 0 to X

Can you assist me with this challenge: I need to prompt the user for an input, X, and then display numbers from 0 to X and from X to 0 using just one variable. How would I go about solving this in Java? ...

Guide to transferring a Django text field to an HTML attribute and accessing it with JavaScript

Looking to transfer a caption from a Django template to JavaScript for an image? Below is the relevant portion of the HTML code: <ul id="portfolio"> {% for picture in gallery_selected.photo_set.all %} <li><img src={{ picture.path }} a ...

Although JQuery is able to remove a row from the page, the record in the database is not

I'm having some trouble using jQuery and Ajax to delete a row on the page as well as a record in the database. The row on the page is successfully removed, but the PHP file isn't being called. I only have an echo statement in the PHP for error ch ...

Is there a straightforward method to send JSON data using $.ajax in jQuery? (By default, jQuery does not handle JSON data transmission)

I've been attempting to send a nested JSON structure using $.ajax or $.post (tried both methods). The $.ajax code I used is as follows: $.ajax({ url: '/account/register/standard', method: 'post', data: datos, dataT ...

retrieving the smallest and largest values from a date range selector

I have been implementing a date range slider following the guidelines from this resource. I successfully set up the slider according to the documentation, but now I need to retrieve the minimum and maximum values as the slider is being moved. I attempted t ...

php json with multiple dimensions

Unable to retrieve the deepest values from my json object, which contains an array of images listed as: { "imgs":[ { "Landscape":{ "2":"DSCF2719.jpg", "3":"DSCF2775.jpg", "4":"IMG_1586.jpg", ...

Ensuring the Safety of Usernames with JavaScript, PHP, and MySQL

I have come across several articles discussing the implementation of a feature on a registration page that automatically checks if a username is already in use in the database. However, I am concerned about the security implications of this approach. I fea ...

Manage numerous canvas animations

Is there a way to interact with an already drawn Canvas animation? I am attempting to create 3 distinct tracks that can be controlled by a "Start" and "Stop" button. However, when I click the Start button on the first canvas, it triggers the last canvas in ...

What is the best way to run multiple commands using JAVA code?

As a Java beginner, I am attempting to restart my Tomcat server using Java code. Thus far, I have been able to stop and restart Tomcat successfully with just two commands in the line exec("cmd /c start cmd.exe ...). However, when I try to add a third comma ...

Errors in socket.on Listeners Result in Inaccurate Progress and Index Matching for Multiple Video Uploads

Is there a way to make sure that the `socket.on('upload-progress')` listener accurately updates the upload progress for each video as multiple videos are uploaded simultaneously? Currently, it appears that the listener is updating the progress fo ...

Encountered an error while attempting to complete the 'send' action with 'XMLHttpRequest'

I am currently developing a Cordova application that makes use of ajax. Everything works perfectly during debugging, but once I build the release version, I encounter this error: {"readyState":0,"status":0,"statusText":"NetworkError: Failed to execute &ap ...

Implementing an onclick event listener in combination with an AJAX API call

I'm really struggling with this issue. Here's the problem I'm facing: I have a text area, and I need to be able to click on a button to perform two tasks: Convert the address text into uppercase Loop through the data retrieved from an API ...

ng-table Filtering with dropdown selection

Hello, I am currently working on creating a Ng-table with a select dropdown menu for filtering the results. Here is where I am at so far. 1) How can I remove one of the pagination options that appear after applying the filter? I only want to keep one pagi ...

The functionality of the Ajax call ceases to function properly on mobile devices after a period of time

I'm currently developing a mobile application using Cordova, AngularJS, and jQuery. My issue lies in trying to retrieve two files from the same directory. The first file retrieval is successful and occurs immediately after the page loads. However, t ...

Issue with componentDidUpdate not triggering consistently on subsequent mounts in React

One of the functions in my codebase is responsible for switching windows (components) on a single page when a button is clicked. This particular function handles the window swapping logic: getProfileContent = () => { var html = []; if (this.st ...

Why does the Roman to Integer conversion in JS only convert the first character?

Struggling with Leedcode question 13: Given a roman numeral, convert it to an integer. The input is guaranteed to be within the range from 1 to 3999. I've written some code below, but I'm puzzled as to why it only converts the first character in ...

Tips for delivering a variable to a React Native Stylesheet

Is there a way to pass a variable to the "shadowColor" property in my stylesheet from an array declared in the code above? I keep encountering a "Can't find name" error. Attempting to use a template literal has not resolved the issue. Any assistance w ...

Transferring data from PHP to AJAX and then injecting it into an SQL query

I've been attempting to pass a datepicker variable into an onclick ajax function, which then sends it to another ajax method that passes the variable to an SQL query. The result of the query is then passed back into the ajax function to generate a cha ...

Obtain real-time performance logs with Selenium (Java, Kotlin)

Currently, I am trying to find a solution for retrieving selenium performance logs. I have discovered a method that allows me to access log entries by using the following code snippet: val loggingPrefs = LoggingPreferences() loggingPrefs.enable(Lo ...

While attempting to dynamically add styles to a stylesheet using JavaScript, an error message was encountered stating "Cannot read property 'length' of undefined"

I am currently developing a custom polyfill that enables older browsers like Internet Explorer to interpret and run media queries using traditional CSS selectors. The process is outlined as follows: Iterate through each stylesheet found in the document A ...