• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpSession Object creation with mulitple browser windows

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

It is mentioned in HFSJ that even if an user opens multiple browser windows , they all share the same Session Object.

This works properly for FireFox ( I donno whether IE Older versions do the same)

Observation: FIREFOX
INFO: Server startup in 1078 ms
WINDOW 1
SESSION: New Session initiated, created at 1176895778968
(Refresh in same window)
SESSION: Old Session continued, created at1176895778968
SESSION: Cookie from browser is SESSIONID=3C91D4D3C52FDFC523464A60CF518352

WINDOW 2
SESSION: Old Session continued, created at1176895778968
SESSION: Cookie from browser is JSESSIONID=3C91D4D3C52FDFC523464A60CF518352


But in IE7 a new Session Object is created for every window.

Observation: IE7

INFO: Server startup in 1266 ms
SESSION: New Session initiated, created at1176889730984
(Refresh in same window)
SESSION: Old Session continued, created at1176889730984
SESSION: Cookie from browser is JSESSIONID=B80893D3E437E07117E3C6CBED44EFC0

New Window opened

SESSION: New Session initiated, created at1176889771375
(Refresh in same window)
SESSION: Old Session continued, created at1176889771375
SESSION: Cookie from browser is JSESSIONID=4AD268C2B910C72F5DBAFE34808E1B73
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes this is a fact, Firefox share the session, IE dont'.

So if your application needs to run in every browser you might want to use the request scope in some of your servlets/jsp
 
Vijay Raj
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the prompt reply , but 'IE' means all versions of IE?
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IE can have multiple windows share the same session, but the additional windows MUST be spawned from a window that is already participating in a session. By spawned, I mean the orginating window can create the other window or the user can press Ctrl+N to create a duplicate of the originating window.

Vijay, we don't have many rules around here but we do have a Naming Policy. Please review our policy and update your display name accordingly. Specifically, the name "Vijay" is only a first name and the policy requires both a first and last name. Thanks.
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Oscar Gonzalez:
So if your application needs to run in every browser you might want to use the request scope in some of your servlets/jsp



This approach will not solve the problem: sharing information between multiple request of the same user.
 
Vijay Raj
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot to everyone ..and i have changed my name.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question for you people,

If I have a page with 2 links, and this links opens 2 new window,

how can I do that this 2 window have differents sessions between them? A map:


Example: The parent window open a child window with the session ID: 111222, then the parent window opens another child window and this still have the session ID:111222.

I try this in ie and firefox.

Thank you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic