Results 1 to 2 of 2
  1. #1
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Rep Power

    Default problem with htttpSession with multiple browsers at a time

    hi to all,

    I am facing with a problem with session attributes and using two browsers for same application at a time. I explain my problem step wise

    senario 1:[browser1]

    I am logging into my application from login page from a browserwith for eample userid = 100872
    and some password .If he is a valid user I am putting all user related variables into session attributes including userid.I did some operations with my application and it is working fine and i am inserting some data into database hwne it is required against to userId from seesion. For example i opened a saveData.jsp

    Now my problem came into picture in second situation

    senarion 2:[browser2]

    Now I opened same url in another browser and logged with another useid say 100001 and some password.Same thing happens as exaplained in case one puutng all variables into session.

    I went to browser1 and as i explained I already opened saveData.jsp .If I submit the saveData.jsp form in browser1, it is inserting all data against to 100001 which was not correct . actually it will isert data agaiinst to 100872 .

    How to over come above problem.I thing the problem is because when i open new browser it creates same session and it overides the previoyse values with new values.Because saveData.jsp in browser1 is static page which i was opened in senario1 ,when submit clicked it isert data into database with new session values

    Is there any to over come this problem. I mean each browser sholud work independently.

    I hope you understand my english any way soory for my english.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power


    You can't.
    Those browsers (assuming they are the same browser, that is both are IE or both are Firefox) are using the same cookies and session ids, and so the same session, on the server.

    You could send login details back and forth in the URL, but that's just not secure.

Similar Threads

  1. help with browsers
    By paulpa66 in forum New To Java
    Replies: 1
    Last Post: 08-07-2010, 01:41 PM
  2. Waiting on multiple semaphores at the same time
    By flok in forum Threads and Synchronization
    Replies: 3
    Last Post: 11-10-2009, 03:31 PM
  3. upload multiple picture at one time
    By chaiwei in forum Java Applets
    Replies: 3
    Last Post: 10-30-2009, 05:39 AM
  4. Make multiple JTextFields focus at the same time.
    By toymachiner62 in forum AWT / Swing
    Replies: 6
    Last Post: 10-09-2009, 02:59 AM
  5. First Applet not running on browsers
    By Centinela66 in forum Java Applets
    Replies: 11
    Last Post: 10-09-2008, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts