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 7897159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:05:26+00:00 2026-06-03T08:05:26+00:00

Below is the two ways I know how tomcat keep session as so far.

  • 0

Below is the two ways I know how tomcat keep session as so far.

  1. In URL add parameter like “JSESSIONID=xxxxxxxxxxxxxxx”, every time when a request send to server side, tomcat will query the session-map with “xxxxx”
  2. Add a field in cookie like “JSESSIONID=xxxxxxxxxxxxxxx”.

So, in my understanding, if we disable Cookie in browser, and visit our page with a URL without parameter like “JSESSIONID=xxxxxxxxxxxxxxx”. The session id will be changed.
Write a piece of code in jsp

<%  
    out.println(request.getSession().getId());  
%>

whenever we visit this jsp, session id will change. But the fact is that sessionId is never changed.

I observed the cookies in browser, I have indeed disabled cookie.
When the first time I visit the page, the request and resonse like below:

    Request URL:http://localhost:8080/examples/testt.jsp
    Request Method:GET
    Status Code:200 OK
    ----------
    Request Headersview source
    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Charset:GBK,utf-8;q=0.7,*;q=0.3
    Accept-Encoding:gzip,deflate,sdch
    Accept-Language:zh-CN,zh;q=0.8
    Cache-Control:max-age=0
    Connection:keep-alive
    Host:localhost:8080
    User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19

    -------
    Response Headersview source
    Content-Length:342
    Content-Type:text/html;charset=ISO-8859-1
    Date:Sat, 05 May 2012 03:01:32 GMT
    Server:Apache-Coyote/1.1
    Set-Cookie:JSESSIONID=6C71760FD3B85C4696CD8E6204574A06; Path=/examples

When the second time I visit the page, the request and resonse like below:

Request URL:http://localhost:8080/examples/testt.jsp
Request Method:GET
Status Code:200 OK
--------
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:GBK,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:JSESSIONID=6C71760FD3B85C4696CD8E6204574A06
Host:localhost:8080
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
--------
Response Headersview source
Content-Length:342
Content-Type:text/html;charset=ISO-8859-1
Date:Sat, 05 May 2012 03:03:19 GMT
Server:Apache-Coyote/1.1

Could someone tell me how tomcat keep a session when cookie is disable and URL doesn’t contains “JSESSIONID=xxxxxxxxxxxxxxx”.

Thanks very much.


I have made a mistake when I disable cookie in Chrome, I haven’t really disable cookie in the above test.

  • 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-03T08:05:28+00:00Added an answer on June 3, 2026 at 8:05 am

    You haven’t disabled cookies. The browser is sending the cookie in the request headers.

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

Sidebar

Related Questions

In the code below I tried in two ways to access the parent version
Below are two ways of reading in the commandline parameters. The first is the
I can implement event handlers in javascript in two ways as mentioned below, I
There appears to be at least two ways to add a default constraint using
Just curious, is there any difference between the two ways below for file reading?
I know that there are several ways to define a function in JavaScript. Two
I need a function that can return the difference between the below two dates
I am getting the following failure message when i build on the below two
Below are two programs that are almost identical except that I switched the i
The routine below does two scans over an input stream of hypertext. The first

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.