Session state variables across multiple ApEx applications

We have a suite of loosely integrate ApEx applications that all share a common authentication scheme. When you first log in we attempt to load a series of session state variables with temporary data to streamline various logging and authentication related activities for the life of the session.
However, these session variables seem to disappear when you move from one application to another, so they are not truly tied to just the "session" which carries over across all applications, but the application from which the session state is set.
What is the suggested way, keeping in mind that the data being held may have security related context, to preserve values during a session, but regardless of which ApEx application you are in.
The method we are using to share the authentication is using a common "Cookie Name" from a common subscribed authentication scheme as suggested elsewhere on this site and seems to work very well outside of this specific issue.
Thanks in advance,
Barney

Apologies for the delay getting back on this.
My use of the word "disappear" was probably misleading. They were not visible from the second application. When setting "Session State" I was under the impression that it was setting it for the authenticated session, not for the specific application. (I am referring to the: apex_util.set/get_session_state).
Your solution will work fine, as long as I know which application the user last authenticated against. However, it could be one of over 30 (and growing) different applications which would require me writing a program to go through every "p_flow" to try and find a valid value every time I need to reference the field.
It would be really beneficial if you could store true Session variables which stay alive for the life of the authenticated session and is available to anything authenticated against that session id. This would streamline alot of cross-application program development.
The "get/set_session_state" is a misleading as it is not a Session value, but an Application value. The Session exists across multiple applications, while this procedure does not.
Thanks,
Barney

Similar Messages

  • Session state consistency - how does APEX keep session state across pages

    I would like to know how the APEX develper tool keeps session state from being overwritten across mutiltple pages in the same Session. Because this is difficult to explain I'll use an example from withing the APEX dev tool
    For Example:
    1. I navigate to the page (4150) thet allows me to edit my Page 880 [Window 1]
    2. I now do a Cntrl^N to Open a New Window in the same session (this opens on the same Page 880 in the new window) [Window 2].
    3. In Window 1, I click an item to update ie I want to put a comment on the Unconditional Branch so click this to go to the Update page. I see the F4000_P4313_ID is passed in the URL (ie the context, UID of the Branch).
    4. In Window 2, I change the page to 881 - ie this is overwriting my Session State variables for page 880 with page 881.
    5. I click an item in Page 881 to update ie I want to put a comment on the Unconditional Branch so click this to go to the Update page. I see the F4000_P4313_ID is passed in the URL (ie the context, teh UID of the Branch).
    6. In Window 1 (the Page 880), I add a comment to the Branch and 'Apply' changes. On returning to the Page the context has changed from 880 to 881 (as expected as Window 2 had overwritten the session state). Slightly confusing for the user as they did go from Page 880 not 881 but ok
    What intrigues me is how the Edit Branch page applied the update to the correct branch [good !]. Why weren't the Branch Session state variables (ie the Branch for Page 880) overwritten with the Branch Session state variables for the Branch from Page 881 ?
    Both navigations go to the same Page passing the UID of the branch, hence I would of thought the last navigation is the one that would be persisting (ie from Page 881 Window) ?
    Any tips on preventing users updating the wrong record because of the Session State being overwritten would be most welcome.
    Look forward to hearing from you.

    Let me take a shot at explaining this.
    Session state is stored in Oracle database tables. When a APEX page is rendered, those tables are read and the HTML is sent to the browser. When that page is submitted, all the HTML form inputs on the page are saved back into session state over-writing any existing values for that session
    So, in your example, since Page 4313 has the hidden page item (the "GUID" of the branch), it doesn't matter if any other window has the same page open with some other GUID. Each page is a self-contained "unit" which has all the information necessary to properly process that page when it is submitted.
    Think of it this way...in your example, when you have windows 1 and 2 open (window 2 was opened after window 1), go back to Window 1 and click the browser's Reload/Refresh button. Instead of refreshing the same page (branch 9000000), you will find that it will load branch 8000000! This is because session state is read from the database and when Window 2 was rendered, it has set F4000_P4313_ID in session state to 8000000.
    Hope this helps.

  • Authentication Across Multiple Web Applications (Revisited)

              Its been an ongoing battle, but I've made some insight into this situation. The problem stands as it seems impossible to authenticate against one web application deployed as a WAR archive and have that authentication carry across to another web application with the same security constraints. I've been told by BEA that, quote:
              "It seems to me that we are violating section 11.6 of the servlet 2.2 spec which talks about webapps"
              I've also been told that this is fixed in WLS 6.0, reference issue #38732.
              For those of us building production environments using 5.1 instead of 6.0 XML based configuration, this does NOT solve our problem.
              I've dug further into the bowels of 5.1 and found that if you manually set the realm name in the login-config of the security constraint in the web.xml file in each WAR deployment as such:
                   <login-config>
                        <auth-method> [whichever method] </auth-method>
                        <realm-name>WebLogic Server</realm-name>
                   </login-config>
              Authentication will carry across web applications. However, I've noted that the session management then becomes unpredictable. For example:
              I log into the application TESTAPP1 which contains a protected servlet that outputs the session ID and attempts to get the authenticated principal name from the "_wl_authuser_" session variable. Upon first load of the page (after the login dialog box), the session is null [can be fixed with .getSession(true) call instead] and the "_wl_authuser_" object does not exist. Reload the page and the session appears as well as the "_wl_authuser_" object. Strange.
              I then move to TESTAPP2, which does not prompt me for authentication but also is missing the session in the same manner. Upon browser reload, the session is created with a different ID and the "_wl_authuser_" object is now available with the appropriate principal name.
              Upon moving back to TESTAPP1, I am not prompted for authentication however, I am assigned yet another session ID after browser reload, different from the first.
              So it seems that although authentication is carried across web applications, the session IDs as you move from TESTAPP1 to TESTAPP2 change, and then change again but not back to the original when going back to TESTAPP1.
              This is a particular problem since we are using Vignette's V5 as our main client and tracking sessions through V5 - this would quickly become unmanageable if a single page view access three or four different application components with three or four different session ids.
              I'm wondering if we can expect the same behavior from WLS 6.0?
              Ideally, I'd like to see WebLogic use a single session ID to track users across multiple web applications but still have session independence between applications. So if I store something in session in TESTAPP1, its not available in TESTAPP2. Does this outline the behaviour in WLS 6.0? Can anyone verify this?
              Some food for thought. Thanks!
              ./Chris
              Senior Systems Anaylst
              MassMutual Financial Group
              

    Hello! I am searching an answer to this question too!!!
    Did you get some news regarding this item?
    Regards,
    C.M.

  • Different ways to referencing Session State variables

    Hi,
    According to APEX documentation there's 4 different ways to reference session state variables: http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/concept.htm#BEICHBBG
    In an inline PL/SQL statement, what's the difference when using the different methods? I remember reading something that the bind and static text have a size restrictions. What's the difference between the V() and NV() functions?
    Thank you.
    Martin

    Martin,
    In PL/SQL, the preferable method is to use bind variable notation, e.g., :P1_ITEM. In HTML contexts, you must use &ITEM. notation. In stored procedures, you can use v or nv, the latter function being identical to the former with the additional characteristic that it raises an exception if the retrieved value is non-numeric.
    Scott

  • Executing multiple apex applications from EBS

    Hi,
    We have developed an apex application which can be triggered through an application link from Oracle EBS. Now, we have a requirement to run multiple apex applications from a single EBS session simultaneously.
    Can someone provide information on how this can be acheived?
    Raajkumar G

    Hi,
    We have developed an apex application which can be triggered through an application link from Oracle EBS. Now, we have a requirement to run multiple apex applications from a single EBS session simultaneously.
    Can someone provide information on how this can be acheived?
    Raajkumar G

  • Sharing portlets across multiple portal applications

    Hello all,
    I have a single enterprise application that consists of several portal web applications. Most of these portal web applications have common portlets within their codebase. Is it possible to share portlet code across multiple web applications?
    Thanks

    No, not possible, in the same way that sharing JSPs and Pageflows wouldn't be possible across multiple webapps. You can, however, have multiple portals within one Portal webapp, and then you could share portlets and portlet resources amongst those portals.
    George

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • Session State Protectio Violoation in Apex 4.2 Page Items

    I'm testing my Apps that I upgraded from 3.2 to 4.2 and getting the message below and haven't been able to understand why.
    Error Session state protection violation: This may be caused by manual alteration of protected page item P2_PAY_NO. If you are unsure what caused this error, please contact the application administrator for assistance
    How the Page works.
    1. Before Region Process runs that pre-populates some of my Text Items.
    2. The user then has the ablibity to select from a select list item that will re-populate the items populated during the Before reqion based on the date selected.
    I do this by calling the code below with an "onchange="javascript:date_populate(this);" on the HTML Form Elements Attributes.
    {var myString = $x(pThis).value;
    var mySplitResult = myString.split("|");
    $x('P2_START_DATE').value = mySplitResult[0];
    $x('P2_PAY_YEAR').value = mySplitResult[1];
    $x('P2_PAY_NO').value = mySplitResult[2];
    $x('P2_PICT_CODE').value = mySplitResult[3];
    $x('P2_END_DATE').value = mySplitResult[4];}
    3. When I submit the page I get the Session State Violation.
    All Items have "Session State Proection" set to "Unrestricted"
    Session State Protection is "Disabled" for the application.
    Edited by: spuchc on Apr 12, 2013 2:07 PM

    Check you are not updating items of type "Display Only".
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Can multiple APEX application use the same parsing schema?

    Hi,
    I have 4.2 APEX thru pl/sql Gatewat, 11gr2 DB and using theme 24.
    Due to the APEX limitation for version control I would be splitting 1 big ERP applications into 24 different APEX applications and each application would be considered as 1 unit for version control.
    I have about 800 tables and I would assume that all of these would need to be stored in 1 schema since a lot of these table are linked thru FK.
    Can I have multiple APEX APPS using the same parsing schema? or is there a better way to do this?
    Thanks in advance!

    Hi,
    Multiple applications can have same (one) parsing schema.
    You can test that on e.g. apex.oracle.com, where normally you have only one schema and you create multiple applications and all use that same schema.
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai
    Edited by: jarola on Jan 28, 2013 7:15 PM

  • Sharing persistent package variables across multiple sessions

    I don't think this is possible, but I'd love to be proven that it can be done. Basically I'm looking for something similar to the static classmembers concept in various OO languages.

    Doesn't exist in any documentation I've ever found. Instead you can try this:
    Create a table and make the variables you want to share the columns of the table. Then insert one row of nulls. Give your users update but not insert or delete privileges on the table. Then you'll have a table with one and only one row with a columns for your global values.
    Best!
    Randall
    null

  • SSO for multiple APEX applications on the same instance

    Hi All,
    We have an APEX instance with 2 applications configured in 2 workspaces.
    The instance is already configured to use SSO. I have followed thee Metalink note #562807.1 to do the SSO wiring.
    We are planning to incorporate SSO authentication for both the applications.
    Also planning to use different URLs (2 aliases for the server) for the applications.
    eg:-
    App1 will be using http://app1.us.oracle.com/pls/apex/f?p=100:10
    App2 will be using http://app2.us.oracle.com/pls/apex/f?p=200:10
    Is it possible to register SSO on 2 URLs for the same instance?
    Can I execute regapp.sql multiple times on the same instance?
    Please advice me.
    Thanks,
    Sajeesh

    Is it possible to register SSO on 2 URLs for the same instance?You should be able to register as many partner applications as you like. I suggest that you try it.
    Can I execute regapp.sql multiple times on the same instance?Yes, but the lsnr_token value must be unique. That's HTML_DB:hostname:port.
    Your applications in different workspaces will not be able to share sessions but you will probably get the single-sign-on behavior you need.
    Scott

  • Passing Session State Variables to SQL query

    Hi,
    I am using 3 pages in my application build by APEX 3.1.2. Login Page, Report Page and Form Page.
    I am using LDAP authentication for Login Page and I want the user session information to be feeded to the filter query
    being used to display data on Report Page. Is there any way to do that. I know
    there is one variable %LDAP_USER% which is using the userid given on login
    page. But I dont know how to use APEX session variables to filter query. Need
    assistance on that stuff.
    Thanks,
    Gaurav

    Hi Gaurav,
    Session "variables" (global items, application items and page items) can be accessed using v('ITEM_NAME') (for strings) or nv('ITEM_NAME') (for numbers) within sql queries/procedures/triggers etc.
    If you look at the Substitution Strings section here: http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/index.htm#S you'll find more information about this and a list of items that you can use that are set by Apex itself.
    Andy

  • Single log in for multiple apex application in same workspace

    hi forum.
    We created 5 applications based on same schema and all in one workspace now. Actually, initially they were created on different machines. now, we have to authenticate users from AD and depending on user type, have to allow or deny some modules. i have created one pager application which have 5 buttons and can control rendering of buttons according to user logged in but...the problem is, inside the applications, i have restrictions on some reports for some users...now one way was to do that is to create a log in for every application separately and thus every application would exactly know who is logged in. but that would be impractical as we need single-sign-on kind of functionality.
    please let me know how to have a single log in page work for all application inside the apex workspace so that every application would know name of the user currently logged in.
    for the 5 applications, i actually use No_Authentication authentication scheme. and i use following function initially for my one pager application to render the buttons to user or deny
    create or replace function getUserName return varchar2
    is
       userName varchar2(20);
       c owa_cookie.cookie;
    begin
        c := owa_cookie.get('LOGIN_USERNAME_COOKIE');
        userName := c.vals(1);
        return trim(userName);
    end;but i cannot user this function obviously in my 5 actual applications.
    help is requested please.
    bundle of thanks in advance.

    You can create one application that does the login authentication according to your authentication scheme. When authenticated, this login app sets a cookie. That's all the login app does (and maybe show a list of available apps to choose from).
    The other apps have an even simpler authentication scheme. The only thing they have to do is check the cookie and redirect to the login page (Session Not Valid URL) if there is no valid cookie.

  • Updating a variable across multiple files in a book

    Hi guys,
    I have a book file with multiple files (prelim pages and chapters). In the header of each prelim page and chapter file I'm using a variable. How can I make a simple change to the variable and update it across all files that use it? I've tried looking through the menus and opening all files but I can't see any method of making a global change.
    Advice appreciated.
    Cheers
    Carl

    How about File > Import formats …
    1. make a new file (source) where you define just the variable you want to copy to other files (targets)
    2. import that variable from the source file into the target files
    When all the target files are in a .book, you can select them in the book and then use File > Import formats. Otherwise, the same command from inside each target – but you can always make a dummy .book referencing all the target files.
    Setting up a source file first means you can work with only the variables you want to, if you have some that change per chapter and others that stay the same throughout the book.
    N
    [ps] Watch out for the default behaviour of the Import from Document pulldown, which sets itself determinedly to "current file"

  • Cookie handling & navigation across multiple BSP applications

    Hi All,
    This is my scenario...
    I have a main BSP application (say YYYY) which is the user login application.  The application class is ZCL_YYYY.  This application will enable the users to login.  This application will show up the list of other applications say (application AAA - class ZCL_AAA, appln BBB-class ZCL_BBB,  etc).  User can click on the application and navigate. 
    I am storing the password in server side cookie and during navigation to other application from my main application I am passing the user id in the URL (like http://....htm&user=mmmm).  The other application will validate the user id against the server side cookie and then proceeds further.  
    I tried using client side cookie but it is working only with in single application but not across applications (I used response->set_cookie in initialization event of main bsp appln and request->get_cookie in the called application in request event). 
    Is there a better way in handling this navigation??.
    My issue is sometimes(very rare cases but still an issue) when the traffic is more, one user is gets the other user's screen, that is when two users click application AAA at the same time, both the users are getting the same information (which is different for different users). 
    Kindly suggest.
    Thanks,
    Krish

    Thanks Raja & Raja...
    In my scenario, the user logging in is the customer (KNA1-KUNNR).  All the BSP application are going to come in with the same SAP user id which is set in SICF.  For SAP transaction user id is going to be SAP-WEB user. 
    The user logs in with the customer number as user id (we have web users for KNA1 created using SU05).  The first will be the login screen where the customer enters his number and password.  The user id and pwd is validated and then the list of applications page will get displayed (as far as SAP is concerned, the transaction is going to come in with SAP-WEB user id).  Once the application is clicked, the password is stored in server side cookie like.. (since SAP user id is going to be same across it was passed as NONE)
      call method cl_bsp_server_side_cookie=>set_server_cookie
        exporting
          name                  = v_customer
          application_name      = 'NONE'
          application_namespace = 'NONE'
          username              = 'NONE'
          session_id            = 'NONE'
          data_value            = v_pwd
          data_name             = 'NONE'
          expiry_time_rel       = 300.
    In the called application, the cookie is retrieved (it should be with in 5 minutes) and validated again with customer id from the URL.  If there is an issue in validation, navigation will go to login page again.
    Thanks,
    Krish

Maybe you are looking for

  • Itunes wont save changes to apps

    Im trying to sync my ipad, but the summary bar at the bottom won't reflect the changes I want to make.  Next to all the apps that I don't want on my ipad is "will install"  I select it so it goes to "install" (removing the app from syncing to ipad) b

  • RFC Call in a custom login module

    Hi All, What is the best way to call a RFC/BAPI from a Custom Login Module, part of the login stacks? I want to avoid using JCo Client Service, do not want to hard code the connection values in the class. Have anyone of you come across such a situati

  • Setting a JTree renderer breaks the focus traversal order

    Hello, I am not sure what's wrong, but when I set a customize JTree renderer it breaks the focus traversal order of my UI. Can someone tell me what's wrong and also how to prevent it from changing the order of my components? For instance, if I have c

  • How to get rid of background image when I scroll up or down in safari?

    Since I have downloaded OS Mavericks on my macbook pro I have a problems with Safari.  Whenever I scroll up or down on any webpage and ugly background of clipart looking images appears instead of the original grey background.   This is the best image

  • Recovering a table from backup

    Hi, I have a full back up of rman back up / normal back up. I wanted to recover a particular table from the back up without disturbing the current activities on DB/User. DB:11.2.0.1.0 OS Windows 2003 Server