This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

session object

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating session object in my servlet program ,, but when I make a request to a servlet by opening 2 browser it is taking as only one session object.. It is happening only in my latop, in other places if I make a request from 2 browser 2 session objects are getting created, I am using session.getId() to check the ID of session,

Please help me thanks
 
Ranch Hand
Posts: 247
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Internally JSESSIONID cookie is passed in each request to Web Server to identify the session object exclusively allocated for the Client...

If you open a new window or new tab from the existing browser parent window, same JSESSIONID is passed... So it will refer to the same session object...

When you do open a separate new Browser window, a new request is created to the web server and different JSESSIONID is created by Web server and sends as Cookie to the Client...Then, JSESSIONID cookie is sent at subsequent requests to the Server
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Different browsers handle new windows differently; some create new sessions, some don't, some are configurable to do either.
 
sagar shiraguppi
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
 
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sagar shiraguppi wrote:I am creating session object in my servlet program ,, but when I make a request to a servlet by opening 2 browser it is taking as only one session object.. It is happening only in my latop, in other places if I make a request from 2 browser 2 session objects are getting created, I am using session.getId() to check the ID of session,

Please help me thanks


I agree with David. But, why is this? Is this really happening?
 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It is happening only in my latop only



whats your Laptop company and its configuration ?? just kiding .

 
sagar shiraguppi
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes it is happening with only my laptop, i tried with other laptop who are running on Vista, but only in my laptop this problem, other than this program no issues with any other program, I m still not clear why not only one session is created when I open two browser of same vendor and send a request, If I open say one chrome browser and other IE and sends the request two session are getting created understandably.. But issue is with same two browser and only one session object..
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic