Invalidate session in another context

Hi everyone,
In a nutshell, how to invalidate session of another context residing in another server?
If it is not possible, what is the best approach to achieve something similar to that?
Thanks for reading this.
Z

u can as well use the MBean interface implementations for Tomcat (JBoss)
and call some public method of a MBean under name "jboss.web:type=Manager,path=/,host=localhost,*" - like 'expireSession' passing the sessionId string as param
Rafal Baton Zaczynski
http://baton.pop.e-wro.pl - Java/JSF/JavaScript - tips&tuts

Similar Messages

  • Reload Page + Invalidate Session

    (ADF 11gR1 ADFBC) I have an ADF application which can be run with different contexts.
    Every user has a “last_selected_context” stored in the database.
    When launching the application, I fetch this “last selected context” and in the “beforePhase” of the “PagePhaseListener”, I set all my session variables for this context.
    Users may swap from a context to another by selecting it from a popup.
    My problem is : when a user select another context, I have to invalidate the session and reload the page.
    I did this in a function “reloadThePage()”
        public static void reloadThePage()
          FacesContext fContext = FacesContext.getCurrentInstance();
          String viewId = fContext.getViewRoot().getViewId();
          String actionUrl = fContext.getApplication().getViewHandler().getActionURL(fContext, viewId);
          try
            ExternalContext eContext = fContext.getExternalContext();
            String resourceUrl = actionUrl;
           // Invalidate Session
           HttpSession session = (HttpSession)JSFUtils.getFacesContext().getExternalContext().getSession(false);
            if (session != null) {
                session.invalidate();
            eContext.redirect(resourceUrl);
          catch (IOException ioe)
            System.err.println("Problem trying to reload the page:");
            ioe.printStackTrace();
        }It is working fine, but I have this Warning message every time a change the context: Because of inactivity, your session has timed out and is no longer active.  Click OK to reload the page+.
    Is there a way to avoid this Warning message?
    Thanks & Regards
    Nicolas

    Hi Timo,
    Thanks for your help.
    I've tried this but I still have the same warning message.
        public static void reloadThePage()
          FacesContext fContext = FacesContext.getCurrentInstance();
          try
            ExternalContext eContext = fContext.getExternalContext();
            String resourceUrl = "/hr2/faces/home"; 
            // Invalidate Session
            HttpSession session = (HttpSession)JSFUtils.getFacesContext().getExternalContext().getSession(false);
            if (session != null) {
                session.invalidate();
            eContext.redirect(resourceUrl);
          catch (IOException ioe)
            System.err.println("Problem trying to reload the page:");
            ioe.printStackTrace();
        }Any other suggestion ?
    Thanks & Regards
    Nicolas

  • Is it possible to invalidate session when I click my browsers back button

    Hai
    I have a question.
    I am building a jsp page with multiple forms.As of now,
    no login system has been implemented.
    I need my session to time out when the client click on the back
    button on the browser to prevent data corruption.
    Is there a possible way to do this in Java/ Script
    I know the use of session.invalidate() but how to tie it up to the
    browser's back button
    A second problem
    If I use session.invalidate() on Tomcat 3.2
    I find that it is not invalidated.But this same function on tomcat 4
    doesn't have any problem
    Could anyone help on these issues
    Thanks

    You don't mean you want to invalidate session every time you move to a new page, do you? If you do, after implementation of login system the users will be asked for passwords at each page. If you don't, it's better to use headers for your response.
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Expires", "-1");

  • How can I copy a track from one session to another?

    I want to copy an entire track (strip setting and audio/midi) from one session to another. The only option I can seem to find is to bounce or export as audio.
    Is there any way to do this besides copy/paste the strip setting, copy/paste the software instrument, copy/paste the midi?

    Why don't you save the channel strip (including the Software instrument) as a preset and insert it in the new session? Doesn't affect Volume and panning though unless it is automated. Then you could copy+paste the Automation. Audio and Midi files have to be copied+pasted.

  • How can I save a session to another hard drive or flash drive?

    I want to rebuild my hard drive but I want to save the Firefox session (like 70 tabs) before I do so I can reload them after the rebuild. Can I save a session to another hard drive or flash drive?

    The data of the current session is stored in the sessionstore.js file in the profile folder.
    See also:
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)

  • Access attribute of a context node in another context node of the same view

    Hi all,
    I want to acess value of an attribute PERNR of context node CUSTOMERS in another context node AUTHENTICATION of the same view. A sample syntax would be helpful .
    Thanks,

    You didn't specify your version of Oracle so here are two options. If 10.2 or greater, use XMLTable, else use the ExtractValue option.
    -- The WITH simply simulates your existing table that I do not have.
    WITH fake_tab AS
    (SELECT XMLTYPE('<?xml version="1.0" encoding="ISO-8859-1"?>
    <Settings>
      <Setting Name="A1" Value="N"/>
      <Setting Name="A2" Value="N"/>
      <Setting Name="A3" Value="SOMEVALUE"/>
      <Setting Name="A4" Value="N"/>
      <Setting Name="A5" Value="Y"/>
      <Setting Name="A6" Value="N"/>
    </Settings>
    ') tab_col
      FROM dual)
    -- For 10.2 and higher use this SELECT
    SELECT a5
      FROM fake_tab,
           XMLTABLE('/Settings'
                    PASSING fake_tab.tab_col
                    COLUMNS
                    a5   VARCHAR2(10)  PATH 'Setting[@Name="A5"]/@Value');
    -- For 10.1 and before
    SELECT ExtractValue(tab_col, '/Settings/Setting[@Name="A5"]/@Value')
      FROM fake_tab;

  • Importing a class from another context?

    Hi JSP techies,
    Im using RESIN and having a simple problem of figuring out how to import classes from another context, if Im using the right word.
    ie.
    My .jsp files are under $home/resin/doc/test dir. And in the jsp file, I would like to import a servlet class or a plain java class. But the servlet classes and all other classes are located under $home/resin/webapps/project/WEB-INF/classes/a/b/c
    Hence when I say
    <% page import="a.b.c.*" %>
    I get an error saying "a" not found.
    1. When I say "servlet classes are in a different CONTEXT", is that right? or is it just another directory?
    2. How can I make the jsp file import the classes from the servlets class path?
    Note: Ofcourse, when I copy the package to the
    $home/resin/doc/WEB-INF/classes dir, everything works fine. But thats simply not an efficient way to get around. Could anyone clear my doubts on this regd.?
    Thanks in advance.
    Arun

    Oh... I get it now. I'm sorry, I had you poorly misunderstood. You are trying to import servlets from another web app or servlet context. I would suggest you put servlets that are common to all web apps in the system classpath and not tie them to any particular web app. In other words create a package directory structure from the system's root directory or any where outside of any web apps and point the system classpath to the beginning of that directory structure. I have a similar thing going with Tomcat. I have a folder in my root called Java_Class which is in my classpath. I build all common utilities in this directory. So I have a com/craig/web structure that holds my AppServlet which is in package com.craig.web. This servlet is visible to all web apps via the Windows classpath. Servlets particular to an application like say an MusicOrderProcess servlet would reside in a package under the webserverhome/webapps/MusicStore/WEB-INF/classes directory where webserver home is the home directory of the webserver you are using. I've tested this across webservers as well (orionserver and Tomcat) and it works.
    From the prompt you include in your posts I am guessing that you are running on UNIX. Move your common servlets out of their respective web apps and into a common directory structure. Configure the UNIX $CLASSPATH (or is it $classpath?) environment variable to point to this sturcture and you'll be on your way!
    Post again if you have more questions!

  • Include a page from another context in a facelet

    Hi,
    I'd like to know how to include a facelet page from another context using JSF. Something similar was done for JSPs in this thread
    http://forum.java.sun.com/thread.jspa?threadID=451823&messageID=2053784
    I'm using <ui:include > in the facelet and tomcat 5.5, but I'm not sure if I should use the FaceletContext -> ServletContext -> RequestDispatcher, etc. and in what way in the facelet.
    thanks!

    That only appears to work within the same context, i.e., if I have two contexts:
    webapps/context1
    webapps/context2
    and the original facelet is in context1, I cannot ui:include a facelet from context2. Doesn't work.

  • RAR 5.3 - kill session of another user

    how can RAR admin kill session of another user?

    Hi Partha,
    There is no way out to kill a user's session in RAR, nor in UME. The only place you can kill a user's session is in backend (R/3 side of a particular system) in T-code: SM04->select a particular session of any user-> end session.
    Regards,
    Gurugobinda

  • Invalidate session in BlazeDS

    Hi!
    I need to integrate BlazeDS security with an external security mechanism so I have implemented custom authentication as described in http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=services_security_1 .html. Now I need to invalidate user authentication on server upon certain circunstances. When this happens, I invalidate Session contained in Request parameter of invoke method of TomcatValve. This seems to work but I get a nasty "Duplicated Http Session" in Flex client telling that cookies where removed in server. Is there any clear way to invalidate current user login from BlazeDS?
    I've also tried invalidating FlexSession but then Flex clients hangs.
    Thank you very much.
    Daniel.

    Ummm - isn't that exactly what a session timeout specifies?
    ie how long should it stick around before it "expires" and should be invalidated?
    You don't need to call session.invalidate() - it will do that all by itself.

  • How to pass data from one internal session to another internal session

    hi all sap experts ,
    How to pass data from one internal session to another internal session and from oneExternal session to another external session.
    Except : Import and Export parameters and SPA/GPA parameters.
    Tell me the otherWay to pass data ..
    Plz
    Thanks in advance

    hi,
      abap memory management u will understand about this concept.
    the import /export parameter will help u that passing data between two internal sessions by using abap memory.
      for syntax
    Passing Data Between Programs
    There are two ways of passing data to a called program:
    Passing Data Using Internal Memory Areas
    There are two cross-program memory areas to which ABAP programs have access (refer to the diagram in Memory Structures of an ABAP Program) that you can use to pass data between programs.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).
    ABAP Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.
    Filling Input Fields on an Initial Screen
    Most programs that you call from other programs have their own initial screen that the user must fill with values. For an executable program, this is normally the selection screen. The SUBMIT statement has a series of additions that you can use to fill the input fields of the called program:
    Filling the Selection Screen of a Called Program
    You cannot fill the input fields of a screen using additions in the calling statement. Instead, you can use SPA/GPA parameters. For further information, refer to Filling an Initial Screen Using SPA/GPA Parameters.
    Message was edited by:
            sunil kumar
    Message was edited by:
            sunil kumar

  • How to pass data from one internal session to another

    Hi SAP Experts,
    How to pass data from one internal session to another and from One external session to another external session. I used import and export parmeter and SPA/GPA parameters. What is the other way to pass data?
    Please tel me urgently
    Thank you
    Basu

    Memory Structures of an ABAP Program
    In the Overview of the R/3 Basis System you have seen that each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.
    The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.
    Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.
    The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.
    The following diagram shows how an application program accesses the different areas within shared memory:
    In the diagram, an ABAP program is active in the second internal session of the first main session. It can access the memory of its own internal session, ABAP memory and SAP memory. The program in the first internal session has called the program which is currently active, and its own data is currently inactive on the stack. If the program currently active calls another program but will itself carry on once that program has finished running, the new program will be activated in a third internal session.
    Data Clusters in ABAP Memory
    You can store data clusters in ABAP memory. ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.
    ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.
    This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data
    From an executable program (report) to another executable program called using SUBMIT.
    From a transaction to an executable program (report).
    Between dialog modules.
    From a program to a function module.
    and so on.
    The contents of the memory are released when you leave the transaction.
    To save data objects in ABAP memory, use the statement EXPORT TO MEMORY.
    Saving Data Objects in Memory
    To read data objects from memory, use the statement IMPORT FROM MEMORY.
    Reading Data Objects from Memory
    To delete data clusters from memory, use the statement FREE MEMORY.
    Deleting Data Clusters from Memory
    please read this which provide more idea about memory
    Message was edited by:
            sunil kumar

  • Hi, ive been having trouble passing my logic sessions to another computer, we're both using a macbook pro 10.6.8 and logic pro 9 with the same plugins, the session opens in the other computer but all the synths reset to presets

    Hi, ive been having trouble passing my logic sessions to another computer, we're both using a macbook pro 10.6.8 and logic pro 9 with the same plugins (native instruments komplete 7), the session opens in the other computer but all the synths reset to presets, this didnt happen the first time I shared a session, but its been happening lately quite often

    kwmlr439 wrote:
    CSOUND Read the title please:
    Re: Macbook Pro 10.6.8 RAM Upgarde to 8 GB
    The amount of RAM is not dependant on the operating system. It is all about the model of you Mac.
    10.6.8 is the version of OS X that is installed on your system. It has no real baring on the amount of RAM that CAN be installed.
    Personally I have never had good luck with Corsair RAM. I have always had good luck with Crucial and Kingston.
    Message was edited by: Shootist007
    Message was edited by: Shootist007

  • Need to connect a web cam and external mike to my McBook Pro running snow leopard for a Skype session with another school. Attached an HP webcam (USB) and can't get video. Any suggestions?

    Need to connect a web cam and external mike to my McBook Pro running snow leopard for a Skype session with another school. Attached an HP webcam (USB) and can't get video. Any suggestions?

    -->Click HERE<--  Does item "B" (Turn video on/off) in the last topic on the page help?
    You control the camera for Skype from within Skype, so  Skype must be running to running to make video work.
    Message was edited by: EZ Jim
    Mac OSX 10.7.4

  • Invalidate session with weblogic.Admin

    Hi,
    I tried to invalidate sessions using weblogic.Admin using the command: java weblogic.Admin -url t3://localhost:8013 -username system -password *** GET -pretty -type ServletSessionRuntime. The output was:
    MBeanName: "R3:Location=PIA,Name=B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731,ServerRuntime=PIA,Type=ServletSessionRuntime"
    CachingDisabled: true
    MainAttribute: [email protected]/ps
    Name: B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731
    ObjectName: B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731
    Parent: PIA
    Registered: true
    TimeLastAccessed: 1102341410448
    Type: ServletSessionRuntime
    Then tried to invalidate it using:
    java weblogic.Admin -url t3://localhost:8013 -username system -password *** INVOKE -mbean "R3:Location=PIA,Name=B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731,ServerRuntime=PIA,Type=ServletSessionRuntime" -method INVALIDATE
    ANd the error message: bash: !1102341400731: event not found
    Do you know how to handle this? Or any other way to invalidate session from weblogic.Admin?
    WLS 8.1 SP1
    Regards
    Tomi

    Hello,
    I have a system consisting of three different departments, each department has its own login page with different username and password.
    from the same browser, all three administrators can log in successfully, during there login, one session is created with different attributes for each of them, if any one administrator logs out, I invalidate the session, which logs out the other two administrators.
    Can I use session Id to log out on administrator while the other two can stay logs in?
    If I am using the wrong approach all together, can anyone suggest an alternative please?
    here is my code to create session:
    // if correct username and password entered then create session
    String financeAdminSess = adminUsername;
    session.setAttribute("financeAdminSess", adminUsername);                                        
    String redirectURL = "finance_admin_home.jsp";
    response.sendRedirect(redirectURL);
    and here is the code for loggin out:
    // get session
    String financeAdminSess=(String) session.getAttribute("financeAdminSess");
    // remove session
    session.removeAttribute("financeAdminSess<br />");
    // invalidate session
    session.invalidate();
    Any suggestion would be much appreciated.
    Thanks
    Shaxo

Maybe you are looking for

  • Website on Mac Mini Server not accessible. Error 403 index document not available.

    Dear all, I'm trying to host a website on my Mac Mini Server. As far as I can see, my DNS is working correctly. Also my firewall is setup correctly. (I'm hosting another website which works OK). But I setup a new site. Basically a copy of the working

  • User Account File Sharing

    I've searched this forum to find my answer, but I'm shocked by what I've read, and although it makes sense, I can't believe OSX (10.4) has been set up this way and want to double check with you guys before I give up. I want to have two user accounts

  • Black "border" around project

    I just started using Captivate 4 (upgraded from 3).  I am building a new project from scratch.  It is 800x600.  My problem is the black border or line that goes around my project - see below.  I am using a customized skin that does not include this b

  • Producer consumer design pattern

    Hello, I am trying to build a simple program that does the following: 1. when program starts, the indicator is initialized to -999 2. when Measure button is clicked, the indicator shows random number continuously. 3. when Save button is clicked, the

  • Timesten and XLA

    I'm investigating TimesTen and am looking to implement trigger like functionality using XLA. The specific trigger-like behavior I'm trying to implement using XLA is to automatically increment table id values using sequences. After researching XLA, I