Issue in session management

Hi All,
I have a problem regarding java session management.
i have created one web application in which i want if user login from one browser instance and opens another instance of same browser and logs in from that then user should be logged out from previous instance. I am using Mozzila 5.0.
Here is what i am doing while creating session in LoginServlet.java
session = request.getSession(false); //return session if already exists
System.out.println("Session object: "+session);
if(session != null)
System.out.println("Session ID Old: "+session.getId());
session.invalidate(); //invalidate the session if already exists
session = request.getSession(true); //Create new session
System.out.println("Session ID New: "+session.getId());
Second and third System.out.println() statements giving the same session id.
This way only the information stored in session when user was logged in from first instance of browser is replaced with the new information stored when the user logged in from second instance of browser, but the user is not logged out from the first browser instance.
Please help me out how i can log the user out from first instance if he logs in from second instance.
Thanks in advance...

Since user in logging again from the same machine so i think invalidating the previous session won't work.
Suppose user opens first instance of the mozilla browser and login as say 'ashok' whose role is normal user now he opens another instance of mozilla by clicking on executable and login as 'mitch' whose role is admin then after successful login of 'mitch' on first window mitch's menus items are getting displayed instead of ashok's.
What i am doing is,
While creating new session on login i first check is any existing session available in above case its true
session = request.getSession(false); //return session if already exists
System.out.println("Session object: "+session);
if(session != null)
System.out.println("Session ID Old: "+session.getId());
session.invalidate(); //invalidate the session if already exists
session = request.getSession(true); //Create new session
System.out.println("Session ID New: "+session.getId());
so control will go inside the if block, here i first invalidate the existing session (this is not destroying the session but only unbinding the information that was stored in the session) and create new session (this is returning the same session which was already exists) and save mitch's information. Since the previous instance was using the same session that will now get the mitch's information so now both instances will show the mitch's information.
I am not getting any way to destroy the existing session so next time new session id will get generated.

Similar Messages

  • Issue with session management with portal 701 AFP

    Hi portal experts,
    We are facing an issue with one of our portal 7 ehp1 running the AJAX framework pages.
    When logging off, the DSM popup is shown and it disappears. However, the backend sessions are kept alive when we look in transaction SM12, which indicates that the backend session has not been closed (proven in transaction SM04)
    The same issue arises when closing a popup window. In this case, no DSM popup is shown and the sessions are maintained as well.
    Popup blockers are disabled
    Portal url and backend url are in the trusted sites collection
    Does this have something to do with the AJAX framework?
    Does anyone have any pointers for us?
    Thanks in advance!
    Regards,
    Luk

    Hi Tom,
    I already came across this note earlier. Currently I'm unable (not allowed) to install the httpwatch utility.
    To add to the complexity, web dispatchers are used to access the portal and used between the portal and the backend systems. If I understood correctly, we need to have the ABAP Security Sessions Enabled setting turned on in this sort of landscape. Is this correct?
    If it is not required, couldn't we just turn off this setting?
    Thanks in advance!
    kr,
    Luk

  • Why did I lose Session Manager, as well as all my DOZENS of saved sessions (online course placemarks etc) with the upgr to 17? NEVER an issue, using FF forever

    After installing latest ff (17.0) session manager was no longer installed. re-installed, but all previous sessions (as I stated dozens, with placemarks where I left off with online courses, pages with possible Christmas shopping items, etc etc) are ALL GONE. Been using FF for at least 10 years and this never happened before. Not a happy open source camper :(

    Are you still using that profile where your extensions were installed?
    * http://kb.mozillazine.org/Recovering_a_missing_profile
    * https://support.mozilla.com/kb/Recovering+important+data+from+an+old+profile
    * http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Session management in Info View with two different logins using single sign

    There is a form with 2 user logins UserA and User B to redirect to infoview with sso in my application. I am able to go to each of the Infoview pages successfully but have the following problem.
    User A logs in and infoview opens in a new IE window and sees his/her folders based on permissions and is able to do his/her work for the first time.
    User B logs in andand infoview opens in a new IE window sees his/her folders based on permissions and is able to do his/her work for the first time.
    <b>After a while when User A tries to access the InfoView in the previously opened IE Window, he/she gets an error message. An error has occurred: The object with ID 2519 does not exist in the CMS or you don't have the right to access it.
    User B is able to continue his/her work. Who ever logs in the last, he/she is able to continue his/her work but the other one gets an error.</b>
    <b>Please let me know on how to address this issue . I added logonToken and tried everything at my hand but no success. Is this session controlled by business objects or by the jsp page. What more changes are required for my jsp page to fix the error. Attached below are the form and the applogon.jsp snippets.</b>
    <B> applogon.jsp</B>
        IEnterpriseSession enterpriseSession = null;
        Exception failure = null;
        boolean loggedIn = true;
         String redirectURL = null;
         // If no session already exists, logon using the specified parameters.
        if (enterpriseSession == null){
            try{
                // Attempt logon. Create an Enterprise session manager object.
                ISessionMgr sm = CrystalEnterprise.getSessionMgr();
                // Log on to BusinessObjects Enterprise
                enterpriseSession = sm.logon(username, password, "cms", "secEnterprise");
            }catch (Exception error){
                loggedIn = false;
                failure = error;
            if (!loggedIn){
                // If the login failed, redirect the user to the start page.
                return;
            }else{
                // Store the IEnterpriseSession object in the session.
                session.setAttribute("EnterpriseSession", enterpriseSession);
                // Create the IInfoStore object.
                IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore");
                // Store the IInfoStore object in the session using the helper functions.
                session.setAttribute("InfoStore", iStore);
                // Store the CMS name for later use.
                session.setAttribute("CMS", "CMS");
                   // Create the IReportSourceFactory object.
                   IReportAppFactory reportAppFactory =(IReportAppFactory)enterpriseSession.getService("RASReportService");
                   // Store the IReportSourceFactory object in the session using the helper functions.
                   session.setAttribute("ReportAppFactory", reportAppFactory);
                // Retrieve the logon token manager.
                ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
                   String logonToken = logonTokenMgr.createLogonToken("", 60, 100);
                   String infoViewURL = null;
                   String tokenParam = null;
                   infoViewURL = "/businessobjects/enterprise115/desktoplaunch/InfoView/logon/logon.do";
                   tokenParam = "token=" + logonToken;
                   redirectURL = infoViewURL + "?" + tokenParam;
                // Retrieve a logon token and store it in the user's cookie
                // file for use later.
                Cookie cookie = new Cookie("LogonToken", logonTokenMgr.createLogonToken("", 60, 100));
                response.addCookie(cookie);
                // Store the logon token for later use.
                session.setAttribute("token", enterpriseSession.getLogonTokenMgr().getDefaultToken());
         // Redirect the user to the relevant tutorial page.
         out.println("You have been logged on to Enterprise.");
         response.sendRedirect (redirectURL);
    Thank You for your help

    // Retrieve the parameters that the user entered into the logon fields.
    <b> user name and password come from here from the above html form into the jsp here. Ted Is this what you are asking for where does the username and password come from
        String username = request.getParameter("user");
        String password = request.getParameter("pass");
    </b>
        IEnterpriseSession enterpriseSession = null;
        Exception failure = null;
        boolean loggedIn = true;
         String redirectURL = null;
         ISessionMgr sessionMgr = null;
         // If no session already exists, logon using the specified parameters.
        if (enterpriseSession == null){
            try{
                // Attempt logon. Create an Enterprise session manager object.
                sessionMgr = CrystalEnterprise.getSessionMgr();
                // Log on to BusinessObjects Enterprise
                enterpriseSession = sessionMgr.logon(username, password, "appserver.abc.com", "secEnterprise");
                   System.out.println("line61");
            }catch (Exception error){
                loggedIn = false;
                failure = error;
            if (!loggedIn){
                // If the login failed, redirect the user to the start page.
                return;
            }else{ this code is in my first post

  • A simple app to secure coldfusion pages - Running into an issue with Session

    Hello, I am testing out how to protect pages in coldfusion and have run into an issue when attempting to create a process by which users can log out.
    Essentially, I have three pages:
    Page A - The form that submits to Page B
    Page B - That checks the form.username and form.password against a database (works fine)
    Page C - Logout page (Which is where I am having an issue).
    Page C throws a "variable Session is undefined" error
    Here is the code on Page C:
    <cfset StructClear(Session)>
    <cflocation url="index.cfm">
    Here is the code on Page B:
    <cfif NOT IsDefined ("form.username")>
    <cflocation url="index.cfm" addtoken="No">
    </cfif>
    <cfquery name="test" datasource="cfdb">
    SELECT * FROM USERS
    WHERE USERNAME = '#FORM.username#'
    AND PASSWORD = '#FORM.password#'
    </cfquery>
    <!---<CFSET Session.LoggedIn = "1">
    <CFSET Session.FirstName = "#test.FirstName#">--->
    <CFIF test.RecordCount IS 0>
    <cflocation url="index.cfm" addtoken="No">
    <CFSET StructClear(Session)>
    <cfelse>
    <CFSET Session.LoggedIn = "1">
    <!---<cflocation url="test.cfm" addtoken="No">--->
    </cfif>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <p><a href="logout.cfm">Log Out</a></p>
    <p> </p>
    <p> </p>
    <p><br>
      This content is protected.
    </p>
    </body>
    </html>
    As you can see, nothing fancy
    Now, I thought that the Session variable could be accessed by any page within a given browser instance, but I am obviously wrong.
    What do I need to do for Page C (my logout page to be able to access the session variable).
    Any guidance is greatly appreciated!

    1.
    “Variable Session is undefined” error comes up when you try to manipulate a session variable which does not exist, as at that point in time. To take care of possible empty session structures, it is good practice to check first if your session is defined.
    So you will have something like:
    <cfif isDefined("session")>
    <cfset StructClear(Session) />
    <cfelse>
    <cflocation url="index.cfm">
    </cfif>
    2.
    To enable you access your session variables from any page in your application, you need to enable session management in your Application.cfm or Application.cfc.
    cfm   <cfapplication sessionmanagement="Yes" />
    cfc        <cfcomponent>
    <cfset THIS.SessionManagement = "Yes" />
    </cfcomponent>
    Reference…http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7c48.html

  • Weird Issue with session collection creation

    Hello everybody,
    While building a fully redundant RDS infrastrcutre I cam across this issue
    While creating the session collection through Server Management on Windows Server 2012 R2 I get the following error:
    "Unable to configure the RD Session Host server - Invalid Operation".
    Here is a detailed spec of the environment:
    - 2 RDS brokers connected in HA mode to a Cluestered SQL Instance
    - 2 RDS license servers that are correctly configured on the session hosts
    - 3 RDS Session Hosts
    All are Windows Server 2012 R2
    I have checked the Event logs also and everything I do not see any issues, the session hosts have correct communication between one another and to the license and rd  broker servers.
    At this point I am really lost.
    Anybody have any ideeas about such a ambiguous error?
    Thank you!
    Above and Beyond Information Technology

    Hi,
    Thank you for sharing your experience here. It will be very beneficial for other community members who have similar questions. 
    Regards.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Win 7 "Desktop WM Session Manager" stopped by FW CS5

    Whenever I start Fireworks CS5 it stops my "Desktop Window Manager Session Manager" thus disabling Aero in WIndows 7.
    Any clues on how to prevent this from happening??
    Everything seems to work fine elsewhere (Photoshop, InDesign, Illustrator) just Fireworks has a problem.

    This seems like an older issue.
    http://superuser.com/questions/26195/issue-with-fireworks-8-on-vista-windows-7-and-aero
    Can someone please comment if they have this happen also.
    Is there some kind of work around that anyone knows of?

  • Web Service session manager not found.

    I'm trying to understand how to use the HTTP utilities, and I'm having trouble just creating a session.  I get a Web Service session manager not found error.  I've read where the client has to support cookies.  My eventual client will be a labview VI that talks to a web server.  I llooked at the Toolsptions, but don't see anything related to cookies.  Not sure if that's what's causing this anyway, but I'm just digging.  Also, I want to eventually send http messages across TCP/IP.  Do I need to use the TCP/IP VIs (i.e. open connection, etc) or do I use the http utilities alone.  If both are needed, how does the httpRequestID and the TCP/IP connection ID correlate.
    Attachments:
    htttGetSession.vi ‏9 KB
    WebServerError.PNG ‏13 KB

    Hi can you please let me know how you resolved this issue?

  • BI Administrator error: Session Management will not work

    Hi!
    I am about to set up BI Administrator Addon in SAP Portal. All the configuration steps seems to be ok.
    Unfortunately when I try to start some of applications of BI Administrator I get the following error:
    Session Management will not work.
    Please check the DSM log file for details
    Question:
    How can I solve this problem?
    Thank you very much!
    regards

    Hi
    This error means--Please notify us of this problem by submitting an IT Service Request (Please Note: In order to log into the Infra system, you will need to preface your NKU account with nku\.  For example, if your user name is smithj7, the "User Name" field would need to be populated with nku\smithj7.)
    under the problem type "SAP BW/Portal.
    Much of EP / BASIS issue.
    Hope it helps

  • Stellent Site Studio Website Session Management

    Hi,
    We are using Stellent Content Server 7.5.2, as well as the corresponding Site Studio Designer/Contributor component. I heard that there is no session management capability via Site Studio. In other words, we cannot_ retrieve user information from an outside source such as LDAP, upon first entry to the website, and maintain that information in session variables during the entire session that the user remains on the site.
    Is this true? And, if so, has anyone found a work around to this issue?
    Thanks in advance for any input.
    Elle

    Those options aren't available from the Manage Site page, they are only available in the Designer IDE.
    If you want those options to automatically apply you can create your own "Manage Site" page by dropping the SiteStudioManager fragment onto a page in your website. Then link the fragment to a Manager Settings file. Edit the Manager Settings so that it applies the defaults & settings you require.
    Alternatively a "Design" mode is available on the website. It's activated in the Designer IDE site Properties - specify Design Mode Role. When these users go into Contribution Mode they can switch to Design Mode.

  • FF29 fails to load Session Manager, old tabs, any add-ons, Cool Preview, etc after upgrade on XP

    FF29 fails to load Session Manager, old tabs, any add-ons, Cool Preview, etc after forced upgrade on an XP system. Connecting to sites, especially support.mozilla.org requires numerous retries. Clicking Add0on shows none of the previous working ones. They are gone. No Session Manager at all. Even reporting this has taken over 3 hours. Yesterday, everything worked fine before the restart to 29. What can be done to recover settings from 2-3 days ago? Thanks for keeping it simple!

    Thank you for your question. Once history is gone, there is not a big chance of getting it back. However there are some places to check. For next time, try to backup your profile [http://kb.mozillazine.org/Profile_backup].
    The crash reports from your troubleshooting information is caused by a hang in the Flash plug in version 13. I understand however that this is an issue with the history.
    *[[Recovering important data from an old profile]]
    *[[https://addons.mozilla.org/en-US/firefox/addon/cacheviewer/ Cache Viewer]] is an add on to help you search through the dates of the history
    *SQLite add on will allow you to open places.sqlite file in the current profile.

  • Server side session management

    Hi All,
    I am trying to achieve server side session management following is my code.
    public static void main(String[] args) {
    crmod_activity.proxy.ActivityClient myPort=null;
    try {
    myPort = new crmod_activity.proxy.ActivityClient();
    myPort.setUsername("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    myPort.setPassword("XXXXXXXXXX");
    System.out.println("calling " + myPort.getEndpoint());
    ActivityQueryPage_Input aqi=new ActivityQueryPage_Input();
    ActivityQueryPage_Output aqo=new ActivityQueryPage_Output();
    QueryType qt=new QueryType();
    qt.set_value("");
    ListOfActivityQuery loaq=new ListOfActivityQuery();
    ActivityQuery aq=new ActivityQuery();
    aqi.setListOfActivity(loaq);
    aq.setActivity(qt);
    loaq.setStartrownum(new BigInteger("0"));
    loaq.setPagesize(new BigInteger("20"));
    loaq.setRecordcountneeded(true);
    loaq.setActivity(aq);
    aqi.setListOfActivity(loaq);
    aqi.setIncludeSubBooks("No");
    aqi.setViewMode("Manager");
    loaq.setActivity(aq);
    ListOfActivityData load = myPort.activityQueryPage("",loaq,"","LDC","false","Manager");
    System.out.println(""+load.getRecordcount());
    } catch (Exception ex) {
    ex.printStackTrace();
    Following is the exception i get
    javax.xml.rpc.soap.SOAPFaultException: Server
         at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:555)
         at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:396)
         at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
         at crmod_activity.proxy.runtime.Activity_Stub.activityQueryPage(Activity_Stub.java:142)
         at crmod_activity.proxy.ActivityClient.activityQueryPage(ActivityClient.java:107)
         at crmod_activity.proxy.ActivityClient.main(ActivityClient.java:83)
    Which is given when the code was not able to create session.
    Please advice.
    Regards,
    JM

    How would the first change break backwards compatability? You are not changing the package access or anything. You are just changing whether or not the inner class has a reference to a parent. Even if someone extended this class, would they really need a reference to the parent?
    It seems like a minor (if any) compatability issue. Please reconsider your decision to not change it.

  • ITS / IAC session management?

    ERP2004 old style 4.7 MSS iviews (ie 60.1.18)
    Having problems with IACs (based on essinmss iview).   
    1st time user navs to the iview fine and all works.  2nd time in they get the 'Start SAP Easy Access' front screen instead of the IAC transaction.  If user clicks the 'log out' link on the IAC before navigating away then they can get back in the 2nd time. 
    So looks like this is an ITS session management issue. 
    Our Basis guys  are telling me that ERP2004 integrated ITS doesn't have a/the rz10 parameter to switch on the session management so that when navigating away from an IAC it shuts the session properly.
    Anyon got any experience with this? Hints tips etc...
    TIA
    J

    I have posted this in another post with same issue. Just putting it here for anybody trying to find solution.
    Note 918265 - SAP GUI for HTML in EP: /!\ Session not fail-safe /!\
    Note 827375 - Integrated ITS 6.40: ~disconnectonclose and IACs
    These notes are talking about upgrading ITS to higher support packages:
    external ITS 6.20 patch level 22
    NetWeaver 2004 Integrated ITS 6.40 Support Package 16
    NetWeaver 2004s Integrated ITS 7.00 Support Package 7
    and upgrading Netweaver kernal to Patch 68.
    Regards,
    Parimal

  • Loaded 20.1. When I add Session Manager extension, address & search bars disappear. Can't retreive unless I reload Firefox from scratch. How to fix?

    No prior Firefox version. Started with 20.1. Have not loaded 20.1 on my other computers, so i don't know if the problem is universal. Need Session Manager because Firefox crashes frequently.

    Session Manager has had a lot of bug fixes the past week, I suspect mostly related to the new per-window private browsing feature. Could you try the new version 0.8.0.5? You need to use the "Versions" page to get it, as it hasn't yet been approved for the main page:
    https://addons.mozilla.org/en-US/firefox/addon/session-manager/versions/#version-0.8.0.5
    Hope that helps. You'll also see some even newer pre-release versions addressing specific bugs. I wouldn't try those just yet unless you see that one of them fixes issues you find in 0.8.0.5.

  • JMStudio Error  "Can not create session manager"

    Hi,
    I'm trying to transmit an mpg file through a simple pc to pc network, using the transmission wizard in the JMStudio, and everytime it causes a "can not create session manager" error, even when I try to transmit .mp3 file
    I'm using an ip like 100.100.0.1 for the sender machine, and 100.100.0.2 for the receiver machine, and I don't know where is the problem
    thanks in advance

    Um,maybe the port that you use for transmission is already occupied.
    Make sure that you are not using JMStudio to transmit streams while trying to receive streams from the same port.

Maybe you are looking for

  • Using Smart-Playlists to create a Recently Played Chart

    Here's a challenge for you: Can you tell me how to make a Smart Playlist that will make a chart, let's say a top 20, of the songs I've played the most in the last week or month? I can do songs I've played in the last week, organised by number of time

  • Smartform in mm

    Hi experts, Help me to find smartform names.. as ineed to develop an ew smartform and add logo as well as change address Outbound_delivery Purchase_Order_V3E

  • TS5223 change icloud e-mail address

    How do I change my e-mail for my iCloud. It won't let me change it on my settings and it's getting really annoying with the iCloud thing popping up asking for my password for the e-mail I don't use it for anymore. I tried reseting the password and th

  • Ideapad Y530-4051- product code for Microsoft Office problem.

    When i open my microsoft word program a box comes up that says that i must enter a 25 digit product code to use the product.  When i put in the product code in, it says that it is invalid. Can you help me with this? Solved! Go to Solution.

  • Does Tomcat 4.01 final release provides JAAS 1.0 ?

    Hi, I want to use Jaas in my Servlets. I want that the user will be authenticated, and then when the user have the authorisation, who can run the servlet. The problem is, I don't find any tutorials, examples, codes to this subject. Can someone tell m