What is the reason for a session ID being retained after a session timeout occurs in JSP?

When working with JavaScript in JSP, I encountered an issue where the userId in session always contains a session ID, even after the session has expired. However, when checking in a Java Action class, the userId is null after the session expires, unlike in JSP. Link to code

Answer №1

Experiment with displaying the session ID in your JavaScript code. You may notice that the session ID changes once the old one expires.

Additionally, analyze how the code behaves when a new session is initiated. It could potentially be assigning the user ID to the new session.

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

Learn how to upload an image using Vue.js and then trigger a custom method

Greetings! I am a newcomer to Vue.js and I have encountered a problem that I need help with. In my component, there is a hidden input for files. When I click a button, the browser displays a window for importing files from my PC. Once I choose a file, I wa ...

Update the useMemo state value after the initial function block has been executed

Currently, I have a list of characters from Dragon Ball Z that users can filter based on gender, race, or both using useMemo. let dbzCharacters = useMemo<CharacterObj[]>(() => { if (filterGenderValue && filterRaceValue) { retur ...

Add a <div> element to a webpage in a random location every time the page is refreshed

I have a variety of 2 types of <div>s displayed on a single page. Collection 1 consists of: <div class="feature">content 1</div> <div class="feature">content 2</div> ...and so forth. Collection 2 consists of: <div class ...

When the add button is clicked, a new radio button will be added along with the value entered in

Hello everyone, I'm working on a form that needs to display multiple radio buttons. Initially, I have set up one radio button with text and an option to add more buttons. Users can add multiple radio buttons by clicking on the "Add" button according t ...

Modifying a table row in real-time with the power of JQuery/JavaScript

I successfully created a table with a for loop in Java Spring and now I'm trying to dynamically show and hide specific parts of it when a button is clicked. Here's a simplified version of what I have: <jsp:attribute name= "scripts"> ...

Guide to sending a reference to a child input element using VueJs

I am currently attempting to pass a ref in order to retrieve the value of the input (base-input component) upon submission. The two components are listed below. Despite having a console.log statement in handleSubmit, the email variable always appears as un ...

How can I stop an AJAX request from being cached?

Is there a way to prevent caching of my get request when using super agent? Thank you ...

Exploring the power of AngularJS and Jasmine: testing multiple instances of a service in action

Currently, I am immersing myself in the book "Mastering Web Application Development with AngularJS" and came across an example test named 'Aggregating callbacks.' The specific example causing me troubles involves the Person object: var Person = ...

Generate a .py file through an HTML button click and save it to your device

My current project involves developing HTML and JavaScript code for a chatbot. I need to implement a feature where, upon receiving a Python program from the chatbot, a download button should be displayed. When users click on this Download button, they shou ...

Using AngularJS to retrieve JSON data from a Grails backend

I am facing an issue with my Grails controller that returns a list in Json format: render([tweets: tweets.take(2).collect { tweet -> [id: tweet.id, content: tweet.tweetContent]}] as JSON) This is how I have set up my UrlMapping: "/tweets/"(controller ...

Update the CSS for InputLabel

I have a drop-down list that I want to customize. The issue is illustrated below: https://i.sstatic.net/hzVtl.png I'm looking to center the text "choose format" within the field and adjust the font size. return ( <FormControl sx={{ m: 1 ...

AngularJS, the element being referenced by the directive is empty

Currently, I am in the process of transferring a jQuery plugin to AngularJS simply for the enjoyment of it. Previously, when working with jQuery, my focus was on manipulating the DOM using jQuery functions within the plugin loading function. Now that I am ...

Displaying a message that prompts the user to overwrite the

Is there a way to create a confirmation popup in the ajax script for selecting information? I need a popup message to appear requesting permission to overwrite address component fields if they are empty. HTML: <html> [..] <div style="wid ...

A error was encountered stating that the formValidation function is not defined when the HTML form element is submitted

Having trouble calling a function and receiving an error message. How can I resolve this issue? The error message reads: index.html?email=&gebruikersnaam=&wachtwoord=&submit=Submit:1 Uncaught ReferenceError: formValidation is not defined at HT ...

Unusual Actions of the JSCH Library

I am having an issue while attempting to run multiple commands via SSH using the JSCH library. It seems that when I execute the code in Eclipse, the program finishes running but the command "mkdir test" does not get executed on the server. However, when ...

Retrieving JSON information using Ajax to enhance Cytoscape visualization

Looking to share a network using Cytoscape web or, if possible, cytoscape.js. Due to the size of my data, I find it easier to export it from Cytoscape desktop and grab it using ajax in my HTML. Previously, before version 3.1.0 of Cytoscape, I could export ...

AJAX Post data transmission on the network: Enhancing data formatting

For my AJAX post call, I need to format the data differently. The server is expecting the data in a specific format when viewed in Chrome Network Headers details. My task is to update the JavaScript code below to meet this formatting requirement: percenta ...

Rapidly generate VueJS templates for quick display

Is there a way, similar to KnockoutJS, to easily render content from a template using an ID? <script type="text/html" id="template-example"><span>Hello world!</span></script> <div data-bind="template: &a ...

Looping through iterations to create circular patterns

How can I fix my code to draw multiple circles in a loop instead of just one? var ss_links_canvas = document.getElementById("ss_links_canvas"); ss_links_canvas.width = images.length * 41; ss_links_canvas.height = 25; var ss_links = ss_links_canvas.getCont ...

The AJAX request using jQuery returned a 301 status code indicating that the requested resource has been permanently

My current setup involves a jquery ajax call to a php file. The ajax request successfully works as intended when the PHP processing time is approximately 40 seconds or less. However, if the PHP processing time exceeds this threshold, the ajax call fails. ...