JSP session getting destroyed when second user logs in

Hi,
I am facing a session related problem in a small login program in jsp. I am using three jsp pages, login.jsp (user logs in), page1.jsp (creates a session and stores username) and page2.jsp (accesses session).
Login.jsp:
No jsp actually. Just a simple html form.
Page1.jsp:
String name=request.getParameter("Name");
session=request.getSession(true);
session.setAttribute("Name",name);
Page2.jsp:
session=request.getSession(false);
if(session.isNew())
System.out.println("new session created");
String name=session.getAttribute("Name").toString();
As expected, it works like session getting set at page1 and used at page2. It works good if users log in one by one. The problem arises when 2 (or more users with different logins) try to access the page at same time. When a new user logs in, the previous user session gets destroyed (session.isNew() becomes true and session Id changes).
Is it the way I am using sessions (missing something), or there is some setting in tomcat server to specify maximum number of logins (sessions that can be handled).
Regards
Kamal

Hi,
Thanks for reply, but I guess the problem is not clear. Let me explain..
A user logs in, he reaches first page (page1.jsp), here session is getting set. Then user goes to page2.jsp where application retrieves the information from session and uses it. It works all well.
When two (or more) user logs in.. First user logs in, he reaches page 1, session is set. But then another user logs in (different id) and a session is set for him as well. Now the problem here is that session for first user gets destroyed at this point, which is unexpected (two sessions should not conflict, on different machines).
Additionally, the problem does not happen necessarily at second login. eg. sometimes 4 users log in and when fifth one logs in, fourth gets logged out (session gets destroyed).
I am not able to figure out, whether the problem is in code (given in first post) or there is some tomcat setting responsible for this behavior.
Regards
Kamal

Similar Messages

  • How to undo the automatically start program to when a user logs on

    I have followed this following directions (http://technet.microsoft.com/en-us/library/cc736643%28v=ws.10%29.aspx#BKMK_TSC) :
    "Using Terminal Services Configuration
    Open Terminal Services Configuration.
    In the console tree, click Connections.
    In the details pane, right-click the connection for which you want to specify an initial program, and then click
    Properties.
    On the Environment tab, under Initial program, select
    Start the following program when the user logs on. This option allows you to configure an initial program for the connection.
    If you select Do not allow an initial program to be launched. Always show desktop, then Terminal Services cannot start a specified initial program automatically when a client connects to a terminal server. Instead, the user must start programs
    by using the default desktop that is displayed during the Terminal Services session.
    If you select Run initial program specified by user profile and Remote Desktop Connection or Terminal Services client, then the program that is specified in the default user profile and in Remote Desktop Connection or the Terminal Services
    client will run when the client connects to the terminal server.
    If you selected Start the following program when the user logs on, in
    Program path and file name, type the path and file name of the program that you want to start when the user logs on to the terminal server.
    In Start in, type the working directory path for the program, and then click
    OK."
    the problem is that now all of the server users get the specific program automatically starts when logged on and i cant undo it because i cant get to the desktop or to the "tscc.msc"
    is there a way to fix it?

    Hi,
    Thanks for posting in Windows Server Forum.
    As this thread has been quiet for a while, we assume that the issue has been resolved. At this time, we will mark it as ‘Answered’ as the previous steps should be helpful for many similar scenarios. If the issue still persists, please feel free to  reply
    this post directly so we will be notified to follow it up. 
    BTW,  we’d love to hear your feedback about the solution. By sharing your experience you can help other community members facing similar problems. 
    Thanks for your Support & understanding.
    Regards.
    Dharmesh Solanki
    TechNet Community Support

  • IPlanet 6.0 SP2 restart on Windows NT when a user logs off the server.

    UPDATE: We have found that the iWS 6.0 only restart with JDK 1.3.1 installed for JSP pages. What is the best JDK to use?
    iPlanet 6.0 SP2 restart on Windows NT when a user logs off the server. If a admin or joe developer logs into the server (C+A+D) and does what ever... When the
    person logs off the NT 4.0 box ... ALL the httpd process restart. We have 80 & 443 & Admin. The processes are running under a user account. Any one have an idea why the process are restarting?"

    Hi,
    You can use following JDK version for Windows NT.
    And please check it out whether WinNT-SP6 as been installed in winNT box.
    Window NT:
    SDK and JRE 1.4 http://java.sun.com/j2se/1.4/
    SDK and JRE 1.3.1_02 http://java.sun.com/j2se/1.3/
    SDK and JRE 1.2.2_011 http://java.sun.com/products/jdk/1.2/
    JDK and JRE 1.1.8_009
    http://java.sun.com/products/jdk/1.1/download-jdk-windows.html
    I hope this helps.
    Regards,
    Dakshin.
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support.

  • Pre populating the database field when a user logs into web forms

    Hi,
    When my users log into the web forms application I want the database name field to be pre populated, how do I do this, I presume it can be defined in the config files ?
    Thanks in anticipation.
    SDG.

    Hi,
    I think u are refering to the username, password, database field (connect string)
    here. If this is the case then you can use LOGON(username, password||'@'||connectstring) procedure and hardcode the connect string.
    Best Regards
    Rajesh Alex

  • How do you make a program run when any user logs in?

    I have an application which will need to run when any users logs in.
    Such that Joe downloads and installs the application, logs out, then Sally logs in and the application runs for Sally.
    Does anyone know how to do this?

    Hey Steve, thanks for that link. It seems to be what
    I am looking for. What is the meaning of the
    ~/Library vs /Library ? They are definitely
    different folders.
    Yes, they are definitely different folders. The "~" character represents the current users home folder, so "~/Library" represents the Library folder that's located inside a users home folder. Anything placed in there will only affect the one user whose home folder you've accessed.
    The "/Library" folder is the Library folder that exists at to root of the boot volume. Things placed in this Library folder will affect all users of the system. Basically it's sort of a "global" Library.
    Also, from a script, how do I add an item to execute
    for that kind of PList?
    That could be tricky based on the structure of that particular plist file. I haven't really looked at it closely but one place you could start is to read the "man" page for the "defaults" command... enter "man defaults" in Terminal. The "defaults" command allows you to read/write plist files, but defaults is not very good at accessing deeply nested plist items.
    Related to that, how do I tell if the logging item
    for my App is already there? I do not want to keep
    adding to the list if it is there. If someone
    deletes my app and then reinstalls it, I do not want
    it to run twice, three times, etc..
    Again, you could possibly read the plist using the defaults command and determine whether your item was already present or not.
    Do you know of the one in the ~/Library path, what
    user it execute as? Since it is all users, it
    probably is root or something like that.
    No, the one in ~/Library is in each individual user home folder. It will execute with the current user's privileges. This is where Login Items normally go when you go through the GUI... "Sys.Prefs -> Accounts -> Login Items" and add a login item for one user.
    Even items placed in /Library, which should execute for all users, will execute with the current user's privileges.
    In the near
    future we might need root privileges, so I might need
    a program to startup for all users as root instead of
    the user.
    Is your app, that needs to run at login time, a GUI application or is it a faceless shell script (or something similar). Your original post gave me the impression that you needed to launch a GUI application. However, if it's a shell script then you probably want to look at doing a LoginHook instead of using the Login Items procedure at the web page I posted earlier. I believe a LoginHook will also give you the ability to run the script as root.
    Check out this link at the ADC website.
    or
    Take a look at this information and this utility at Mike Bombich's website.
    Steve

  • How to Keep all the Portal report menu's are "open" when the user logs on?

    Hi
    I have a question about the BI Portalu2019s configuration.  Does anyone know how to keep the Web Portal (i-vew) report menu's are "open" when the user logs on?
    Thanks.
    For example:
    Web Report Panel
    Report  Folder A 
                  i-view  a1
                  i-view  a2
                  i-view  a3
                  i-view  a4
                  i-view  a5
                  i-view  a6
    Report  Folder B 
                  i-view  b1
                  i-view  b2
                  i-view  b3
                  i-view  b4
                  i-view  b5
                  i-view  b6

    Hi,
    Thank you very much.  The problem is the Folder didn't 'open when the user logs on.  Yes, the iview can be openned.  Does anyone know how to set the default Open for the Folder.  My question is about the folder in BI portal.  Yes, the ivew we can set the defaul Open but we have Folder in the portal and our user wants to be able to see the report lists when they log on to the Portal.
    For example:
    Our Current situation
        Navigation Panel
       .>Act vs Plan report Folder_
       .>Year to Day report Folder_
    Hope To Be (When user logs on the BI Portal)
       Navigation Panel
        .>Act vs. Plan report Folder
            (i-view) Report A
            (i-view) Report B
            (i-view) Report C
            (i-view) Report D
            (i-view) Report E
    .>Year to Day report Folder
           (i-view)  Budget by Cost Element report
           (i-view)  Actual by Cost Center report
           (i-view)  Income statement report
           (i-view)  Balance Sheet report

  • How to create a logon script to delete folder, subfolders and contents when a user logs on ?

    I need to create a logon script which will delete a folder, subfolder and contents when a user logs on. I have no experience with scripting so any pointers you can give would be much appreciated.
    Thanks

    depending on how you have thing set up, it might be easier to make a LaunchAgent to handle this.  do this:
    copy the text below into a text editor
    save it as a plain text file in /Library/LaunchAgents with the file name "user.startup.folderDeleter.plist" (the name doesn't matter so much, but the 'plist' extension is required)
    load the plist into launchd by restarting the machine or by opening terminal and running the command launchctl load /Library/LaunchAgents/user.startup.folderDeleter.plist
    This will delete the folder any time any user logs in.  You could also expand this to delete the folder periodically (once a day, for instance) if that would be helpful.
    Note, this file must be saved as plain text. apps like TextEdit sometimes default to making rich text files which will not work.  Either download a programmer's text editor like TextWrangler, or make sure that TextEdit is using plain text (if the window has a formatting toolbar it's using rich text;  select "Make Plain Text" from the Format menu).
    copy the text below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>user.startup.folderDeleter</string>
              <key>RunAtLoad</key>
              <true/>
              <key>ProgramArguments</key>
              <array>
                        <string>osascript</string>
                        <string>-e</string>
                        <string>tell application "Finder" to delete folder "Final Cut Express Data" of folder (path to preferences from user domain)</string>
                        <string>-e</string>
                        <string>tell application "Finder" to empty trash</string>
              </array>
    </dict>
    </plist>

  • My computer freezes when a user logs out

    Since I updated to Tiger (10.4.5) from Panther (10.3.9) it often happens that, when a user logs out from his account, the computer freezes. The mouse arrow won't move, so it's not possible anymore for anyone to log back in. I have to hold the start-button to force the computer to a shutdown. After restart everything works fine.
    There are 3 other users (the kids) apart from my administrator account.
    Any idea what to do ?

    I suggest reinstalling the 10.4.5 COMBO update, repair permissions after restart, and restart again.

  • Systemd/user: tmux sessions get killed when stopping systemd session

    Following the wiki guide on systemd/user, I am now starting my X sessions using systemd unit files for my user.
    My problem: when I quit X or exit the systemd session (for example through $ systemctl --user exit), my tmux sessions get killed along with it. Note, I do not start tmux with unit files, but simply through invoking “tmux” in a virtual terminal. I have also tried detaching the tmux session before quitting the systemd session, but to no avail.
    How can I make my tmux sessions survive X closing?

    That is beacuse tmux becomes a child process of the systemd --user session.  So it gets caught up in the cgroup and everything.  What I have done is I start a system service of tmux as my user (I have creatively come up with the name "[email protected]").  Here is what I've got, that has been working for me:
    % cat /etc/systemd/system/[email protected]
    [Unit]
    Description=Start detached tmux session
    After=multi-user.target
    Before=shutdown.target
    [Service]
    Type=forking
    User=%I
    WorkingDirectory=%h
    ExecStart=/usr/bin/tmux new-session -d -s %u
    ExecStop=/usr/bin/tmux kill-session -t %u
    Restart=always
    [Install]
    WantedBy=multi-user.target
    Last edited by WonderWoofy (2013-04-27 22:35:27)

  • Firefax hangs in remote desktop when another user logs in on the console

    When I work with remote desktop on a windows 7 pc I could always use firefox without any problem, even when someone else was logged in on the same windows 7 machine. Siince the update of firefox to version 13, ff hangs in the remote desktop session as soon as someone else logs in on the wndows 7 console.

    To be specific, this problem occurs in a multiple concurrent user configuration (=hack), where the RDC user and console users are simultaneous users. Firefox will hang, using 50% of the CPU. As soon as the RDC user walks over to the console and switches to that user the hang is released. The behavior is new to v13 and is highly reproducible.
    For more info on multiple concurrent users:
    [http://www.missingremote.com/guide/how-enable-concurrent-sessions-windows-7-service-pack-1-rtm http://www.missingremote.com/guide/how-enable-concurrent-sessions-windows-7-service-pack-1-rtm]

  • Cannot mount external drive on network when no user logged in

    We have a few workstations on our network that have multiple accounts for users in order to preserve preferences, etc. An external hard drive attached to the each workstation, holds work done on that station by the different users. When all users are logged out, the external drive does not appear as a mountable device when trying to log into the workstation from another computer; only the internal drives are seen and mountable.
    Is there a way to make the external drive visible and available for mounting over the network when no user is logged in? The external drive is set to ignore permissions for that drive in the get info window.
    Additionally, when a user is logged in to the workstation and someone tries to log in over the network to access the external drive, the drive is sometimes available over the network and other times not. What causes this inconsistency?
    thx, j

    You really want to format it HFS+ wiyh GUID Partition scheme to ensure your data transfers correctly...
    How to format your disks...
    http://www.kenstone.net/fcphomepage/partitioningtiger.html
    (On IntelMac the Drive it needs the GUID Partitioning scheme mentioned at the bottom.)
    Not sure if that'll make it see it or not, but your data will be better. Besides, you should be able to install to that then & maybe boot from it to ease matters.

  • Can not control / observe when no user logged in

    Been fighting this for weeks. Searched the forum but found no relief.
    Using ARD 3.2 we can control / observe from our office to several workstations both in our same building and in other offices around the country. On all but one we can control / observe regardless of whether or not a user is logged in. On those, when a user is not logged in, we see the workstations' login window. We can login, etc. On only one machine, which is running 10.4.11, we can control / observe ONLY when a user is logged into it. If no user is logged in we get an "unable to connect" from ARD. Call someone in that office, ask them to login, and immediately we can control / observe that workstation. We highly doubt a port forwarding / router / firewall issue since if it were, we suspect that we'd never be able to observe / control. It appears as though ARD ON THE WORKSTATION is getting disabled at user log out... BUT ONLY ON THIS ONE WORKSTATION! Any ideas, folks? Your help would be appreciated.
    Thanks,
    BB

    Silly me! This one workstation connects via wireless connection, only. We had set, "Disconnect from wireless networks when I log out" in the wireless network's connection settings. All is well now.
    Thank you

  • Windows 2008 R2 TS VPN connection closed when another user logs in

    Hi.
    I have a W 2008 R2 Ent. server with TS
    I have VPN on the TS configured with a L2TP/Ipsec connection to connect to a customer site
    Users will remote into the server, and make a VPN connection (click on shortcut to start VPN) and access the customer's site. This has worked OK for 2 years often with several users logged into the TS via RDP.
    Recently users are encountering this problem: User A logs into the TS, makes VPN connection, accesses customer site. User B logs into the TS, user A's VPN connection is broken immediately. It seems to happen every time - not sporadic.
    Can I get some suggestions on how to troubleshoot this?
    Thanks!

    Hi,
    The error which you are facing is because of Event Id 20226 (RAS connection termination).
    Error 831 (ERROR_FAST_USER_SWITCH)
    The connection was terminated because user switch happened.
    There are multiple login sessions on the user's computer. The user switched from a login session with an active RAS connection to another session. This resulted in the termination of the connection.
    For this you can check that you can limit the connection and tried to switch back the original session and make all new connection again. Please refer “Event ID
    20226 — RAS Connection Termination” for more details.
    Hope it helps!
    Thanks.

  • Get a list of users logged on each server node in a clustered environment

    Hi,
    does anybody know if there is way to get a list of users which are logged on each server node in a clustered environment. Or maybe is there api for that so I could write an application which does that?
    Regards
    Ladislav

    Hi,
    about the code I was looking at - easily you can find out that these iviews are components of <b>com.sap.portal.admin.monitor.par</b>. The thread Thread Overview is implemented by: <i>com.sapportals.portal.admin.psm.PortalServerMonitor</i>. In <i>getThreadsData</i> method there is a parameter <b>portalMonitor</b> so it led me to this code in <i>doContent</i>:
    /* 143*/          IPortalMonitor portalMonitor = (IPortalMonitor)PortalRuntime.getRuntimeResources().getService("com.sap.portal.runtime.application.monitor.PortalMonitor");
    /* 144*/          IPSMData psmData = portalMonitor.getIPSMDataInstance();
    So I have found <i>com.sap.portal.runtime.application.monitor.par</i> and there is a service implemented by <i>com.sapportals.portal.prt.service.monitor.PortalMonitor</i> where is <i>com.sapportals.portal.prt.service.monitor.MonitorCommunication</i>. And this is a service which calls all the nodes in the cluster around asking for info about the threads, requests, ... Here is a method <i>getMonitoringData</i> which works with object <i>com.sapportals.portal.prt.service.monitor.MonitorData</i>. Here in method <i>getThreadOverview</i>:
    /* 396*/          ApplThreadOverview oATOs[] = OverviewMonitor.getApplThreads();
    So in this <i>OverviewMonitor</i> the method <i>getApplThreads</i>:
                 public static ApplThreadOverview[] getApplThreads()
    /*  50*/          return ApplThreadMonitor.getApplThreads(false);
    from here:
    /* 130*/          ApplThreadMonitor hlpAppl = TaskMonitor.getApplThreadList();
    and this <i>ApplThreadMonitor</i> has:
                 private String userName;
                 private String reqName;
                 private String taskName;
                 private String compName;
                 private String action;
    So if you can get this (when the most of the classes mentioned is not in API but CORE part) on each node and ask for it from one place you got the user list at cluster nodes...
    In fact there can be a shortcut to get this info, I have found this ;o)
    Romano
    PS: and thanks for the stars!

  • Illustrator CS3: perfectly fine pdf gets destroyed when placing in Illustrator

    Hi!
    I am new to Illustrator, but I just dont get the problem. A perfectly looking pdf comes out looking all wrong when it is placed in Illustrator.
    This is how the diagram looks in pdf. Perfectly scalable.
    This is how it looks after beeing imported in Illustrator.
    Everything else that was imported form the pdf looks fine. Only this diagramm gets destroyed!
    Why does this happen?

    How was the PDF created? Printed, Exported? Some other method?
    If nothing else helps, you could do the following: it looks like the problems are only in drop shadows and text. You could delete both from the Power Point file, export, save or print the PDF. Then import into Illustrator and recreate shadows and text there.
    I don't think you could transfer the complete graohic from PP to Illy as vector anyway. So rather get away with as much as you can and then complete it.

Maybe you are looking for

  • Problem with logical database DDF in ABAP query

    Hi All,       I have created an ABAP query via the transaction SQ01 using the logical database DDF to retrieve customer master data from tables KNA1 & KNB1. The selection screen used is the screen 903 of the logical database DDF. But now the problem

  • Pics from individual web pages are not showing on summary page

    I've just started trying out iWeb '09. On the Blog summary page, it shows the excerpt from the actual page, but the picture from the actual entry page doesn't show. Shouldn't it show, too? The Media placeholder box pops up when I hover over that text

  • Set Form Value and Submit Via Applet

    Hi Friends, suppose you have a form such as: <form action="submit.jsp" method="post" name = emailForm> <input type="text" name="emailField" size = 43> </form>And an applet appears on the same JSP page that the form resides. This applet is a simple on

  • Auto increment for order numbers

    I am not sure on how to approach this and if its a backend or frontend issue (PHP/MySQL). Generally when you order something online the site will give you an order number that is naturally unique from other orders. I have the order_id field which is

  • How to set Destination URI of a column in a multi row table

    Hi, I need to programmatically set the destinationURI property of a 'messageStyleText' column in a multi-row table. I have used the below code in the processRequest of the Controller of the page: OAViewObject viewObject = (OAViewObject)am.findViewObj