Saving session state

Hi Everyone!
We are looking for an easy-to-use solution for saving the session state in whole.
(We are aware that it is possible to save the sesion state for a single item.)
Our goal is to get a single commando which restores an whole session to another session. We would like to be able to save a session, purge the session (because of old age) and restore it's session state again to a new session.
any ideas?

Hi,
I was thinking that a pointer to the Session object could be stored in a database on the initial loginAre you by any chance referring to the pointer similar to the one that is used in C? If so I guess it is not available in java.
One possible solution where you can persist data across sessions is by the use of stateful session beans. Also you could experiment with the different scopes of the object for achieving your goal.
I hope this helps you. In case I have missed out something please do post again.
Cheers
Giri :-)
Creator Team

Similar Messages

  • Saving session state during pagination

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:152
    I hacked into the PPR function to save the checkbox value into session state during pagination.
    Is there a way to do something similar for checkboxes in the report itself rendered using htmldb_item.checkbox()?
    Or is this an ill-advised effort?
    [The UI requirement here is clear...I have a bunch of items over many pages and I want to select them using checkboxes and have the selections remembered as I paginate back and forth.
    If you use Yahoo Mail, Compose a new message, click on the Insert Addresses link and it pops up a window with all your contacts, you can select them using checkboxes and go to the Next/Previous page and it remembers the selections]
    Thanks

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:152
    Click on the Create/Reset collection button to initialize your own private collection to play with.
    The checkboxes are remembered as you paginate thru the resultset. Basically, the state of the checkboxes is saved into session state using htmldb_Get before calling the PPR function to get the next/previous rows.
    Carl, let me know what you think of the approach. Is it a viable approach? Any caveats?
    [Unfortunately, I had to to make a copy of the builtin html_PPR_Report_Page function to make the above modification in it, didnt see a way to avoid it]
    Thanks

  • Saving session state on authentication

    Hey all...
    In all my applications that interact with each other, I am running an application-level process on authentication which loads two preferences into applicaton-level items. I am seeing different results when jumping into different applications even though the executing code is the exact same in all applications, a stored procedure in the database. Here is a simplistic example.
    When application A calls a page in application B, an "on authentication" application-level process of application B reads two preferences and appropriately populates them into two application-level items of application B. When application A (or B for that matter) calls application C, the same-coded application process in application C attempts to populate two application-level items, but one of them is not being populated.
    It appears that the problem lies only with application C because regardless of whether I come from application A or application B, the same problem happens.
    When I go from application A to application B in debug mode, I see the following in reference to this problem:
    0.05: Computation point: ON_NEW_INSTANCE
    0.05: ...New Session = True
    0.05: Processing point: AFTER_AUTHENTICATION
    0.05: ...Process "Setup Seed Data": PLSQL (AFTER_AUTHENTICATION)
    1.11: ...Session State: Save Item "ORIGINAL_APP_ID" newValue="104" "escape_on_input="Y"
    1.11: ...Session State: Save Item "ORIGINAL_PAGE_ID" newValue="7" "escape_on_input="Y"
    When I go from either application A or application B to application C, I see the same debug messages except for an additional line that doesn't make sense to me. Following is an example:
    0.05: Computation point: ON_NEW_INSTANCE
    0.05: ...New Session = True
    0.05: Processing point: AFTER_AUTHENTICATION
    0.05: ...Process "Setup Seed Data": PLSQL (AFTER_AUTHENTICATION)
    1.11: ...Session State: Save Item "ORIGINAL_APP_ID" newValue="104" "escape_on_input="Y"
    1.11: ...Session State: Save Item "ORIGINAL_PAGE_ID" newValue="7" "escape_on_input="Y"
    <strong>1.11: ...Session State: Saved Item "ORIGINAL_APP_ID" New Value=""</strong>
    In all three applications, the exact same code is being run which determines if the preferences "is not null", and if so, sets the two preferences in the "current" application. I'm happy to show you the code of my stored procedure that does this if you like.
    The only thread I've seen in the forum that looks similar is the following:
    Re: Session state issues
    I've followed its suggestion of deleting and recreating the application-level item, but that did not solve my problem.
    I'm confused as to why the new line indicating "Saved Item" is showing up in the application C. Is there documentation available to explain the difference between "Save Item" and "Saved Item" when running a page in debug mode?
    Shane.

    Here are the different componets that are in play and some notes that may help understand the situation:
    - the failure happened when the two application-level processes below were just one process. works fine when they are split up.
    - the trick of using the SESSION as the USER_ID is because I want the preference to only be good for the session, not everytime the user logs in. ( i learned this trick from the ApEx forum! )
    - the stored procedure is in a package owned by a separate schema than the built-in ApEx user.
    On-Authentication Application-Level process with Sequence 10:
    begin
    :person_id := iv_portal.iv_emp_pkg.get_person_id ( v('USER') );
    apex_util.set_session_state ( 'PERSON_ID', :person_id );
    :core_app_id := iv_htmldb.iv_gen_pkg.get_core_app_id;
    apex_util.set_session_state ( 'CORE_APP_ID', :core_app_id );
    :user_vax_id :=
    substr ( iv_portal.iv_emp_pkg.get_vaxsub_id ( :person_id ), 1, 6 );
    apex_util.set_session_state ( 'USER_VAX_ID', :user_vax_id );
    :user_sub_id :=
    substr ( iv_portal.iv_emp_pkg.get_vaxsub_id ( :person_id ), 7, 1 );
    apex_util.set_session_state ( 'USER_SUB_ID', :user_sub_id );
    :proxy_person_id := apex_application.fetch_app_item
    ( 'PROXY_PERSON_ID', :original_app_id );
    apex_util.set_session_state ( 'PROXY_PERSON_ID', :proxy_person_id );
    end;
    On-Authentication Application-Level process with Sequence 15:
    declare
    l_username varchar2(50) := v('SESSION');
    begin
    iv_htmldb.iv_gen_pkg.setup_homepage_preferences ( l_username );
    end;
    SETUP_HOMEPAGE_PREFERENCES Stored Procedure
    procedure setup_homepage_preferences ( l_username in varchar2 ) is
    l_app_id varchar2(5) := v('APP_ID');
    l_page_id varchar2(5) := v('APP_PAGE_ID');
    l_pref_app_id varchar2(5) := null;
    l_pref_page_id varchar2(5) := null;
    begin
    -- clean up old sessions
    -- cannot do this however due to lack of access to the ApEx tables.
    delete from flows_020200.wwv_flow_preferences$ p
    where user_id != v('SESSION' )
    and user_id in ( select to_char ( id )
    from flows_020200.wwv_flow_sessions$ s
    where s.cookie = v('USER')
    and s.last_changed < sysdate - ( 0.5 ) );
    commit;
    if apex_util.get_preference ( 'ORIGINAL_APP_ID', l_username ) is null
    then -- then set the preference to the current application and page.
    apex_application.debug ( 'setting the ORIGINAL application items.' );
    apex_util.set_preference ( 'ORIGINAL_APP_ID', l_app_id,
    l_username );
    apex_util.set_preference ( 'ORIGINAL_PAGE_ID', l_page_id,
    l_username );
    else null;
    end if;
    -- set the application level items to the preference values
    l_pref_app_id := apex_util.get_preference ( 'ORIGINAL_APP_ID', l_username );
    l_pref_page_id := apex_util.get_preference ( 'ORIGINAL_PAGE_ID', l_username );
    apex_application.debug ( 'about to set ORIGINAL APP ID to ' || l_pref_app_id );
    apex_util.set_session_state ( 'ORIGINAL_APP_ID', l_pref_app_id );
    apex_application.debug ( 'just set ORIGINAL APP ID to ' ||
    apex_util.get_session_state ( 'ORIGINAL_APP_ID' ) );
    apex_application.debug ( 'about to set ORIGINAL PAGE ID to ' || l_pref_page_id );
    apex_util.set_session_state ( 'ORIGINAL_PAGE_ID', l_pref_page_id );
    apex_application.debug ( 'just set ORIGINAL PAGE ID to ' ||
    apex_util.get_session_state ( 'ORIGINAL_PAGE_ID' ) );
    end setup_homepage_preferences;
    Shane.

  • Saving session state in database table rather in websever for Ordering App

    Hi all,
    Ours is a ordering application (telecomm) domain.
    Currently, we are storing user sessions data (Order shopping cart session data) in middle tier (iPlanet web server) which inturn consumes lot of memory resources.
    Shopping cart could be in MBs if order is a huge business order.
    So in order to not to overtax web server (middle tier), we are thinking of storing session data directly in a database table to relieve the overhead on web server and make use of database for storage.
    I read that APEX (html db) is already using this "single metadata table" approach for session data management. But we are not using HTML DB to really look into.
    Can some one advise how to go about storing "user session data" directly in a "database table" for both storage and retrieval purposes instead of storing it in "webserver".
    How does this "metadata table" structure looks like. Is it more generic ?
    Really appreciate your time and help/suggestions.

    Joel,
    Thanks for your response. sorry, i meant to say that "the current application does not use APEX but will look into it".
    To build this is an utterly non-trivial exercise. Oh - it may not be so hard to save session state to a table when you POST a page. But you may want to reference this in many places, and it's a question of can you change all of these references to indirect references from session state in your application.In order to free up the load on webserver, we want to maintain session management in database. Could you please explain the above little more :
    How do we maintain the "user session" with "database table" ?
    Do we need to store "session data" at java object level or by page in database table ? How does the structure of this "metadata table" looks like.
    Thanks for your time.

  • Saving composition/session state to a server for reloading later

    We are creating an interactive quiz for children of up to 20 questions and loading each question into a quiz controller window but the memory is maxing out on tablets causing the browser to crash after 10 questions.
    Is there a way we can save a browser's session state on the server side (or client-side) so that a user can come back to a question later and continue from where they had previously left? Perhaps cloning part of the sym object and saving it as a json array?
    Thanks

    We are creating an interactive quiz for children of up to 20 questions and loading each question into a quiz controller window but the memory is maxing out on tablets causing the browser to crash after 10 questions.
    Is there a way we can save a browser's session state on the server side (or client-side) so that a user can come back to a question later and continue from where they had previously left? Perhaps cloning part of the sym object and saving it as a json array?
    Thanks

  • Problem with application item and session state

    Okay, let's see if I can explain this problem coherently.
    I have a small app (one page), with an application item, F_WHERE_CLAUSE.
    This page has three regions in which there are items that the users can populate for search conditions. A couple of these items are "select list with submit" (I still need to upgrade to the AJAX method, I know). There is another region which has one hidden field, called P1_WHERE_CLAUSE. This field is defined to "Always, replacing any value in session state..." with source type of "Item (application or page.....", and a source value of F_WHERE_CLAUSE with no default value.
    I have a button called "Search" which submits the page and fires a PL/SQL process which builds a where condition based upon the other page items and stores the value to the application item F_WHERE_CLAUSE (correctly).
    For testing, I've made the P1_WHERE_CLAUSE field visible so that I can see what's going on. I've also clicked the debug and session buttons to help trace this. After I click the "Search" button and the page submits, debug shows:
    0.02: ...Session State: Save "P1_WHERE_CLAUSE" - saving same value: "1=1"
    followed later by:
    0.05: ...Session State: Saved Item "F_WHERE_CLAUSE" New Value="lower(primary_class) = 'rock' and country = 'Spain'"
    The field P1_WHERE_CLAUSE displays with the correct search criteria as signified by F_WHERE_CLAUSE above. However, If I click the "session" button to view the session state values, P1_WHERE_CLAUSE shows up as:
    P1_WHERE_CLAUSE Textarea    1=1    U while F_WHERE_CLAUSE displays the correct value still.
    The reason this "problem" came up, is that this page also has three SQL report regions which use &P1_WHERE_CLAUSE. for the where condition. While they display the correct results on-screen, each report region also has the "Export to csv" enabled, and the export seems to be using the "1=1" condition (from the "session" window) instead of the search criteria that the on-screen region is using (F_WHERE_CLAUSE and the displayed P1_WHERE_CLAUSE), resulting in a retreival of all records.
    Anybody have any idea what's going on and why, and how to get the csv export to use the correct value for the where condition?
    Thanks,
    Bill Ferguson

    It appears the "Export to CSV" functionality requires the item value to be set in session state. The P1_WHERE_CLAUSE item value never gets saved to session state. The page is rendered and the value is put in the item on the page but until you submit the page session state doesn't know what P1_WHERE_CLAUSE is.
    Create a before header computation or process to set the value of P1_WHERE_CLAUSE (which will save it to session state). It is interesting that the report regions didn't need to look at the value in session state but the "export to csv" does.
    --Jeff                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to save the session states for a tabular form WITHOUT using check boxs?

    Greeting guys,
    As you know that we can use collections to save the session states of a tabular forms, described in the how-to doc of manual tabular forms. However, what I am trying to do ( or have to do) is to provide a manual tabular form, and save the session states for validation, without using the check boxes. Because a user can put contents into some columns in a row without checking the corresponding checkbox, according to the requirements. So basically what I tried is to loop over all the rows and save Every entry into a collection. However, sometimes I got "no data found" error with unknown reasons.
    My current solution is to use the "dirty" Retry button that gets back the history, which IMO is not a good workabout. So, I'd appreciate if somebody can shed some light on a better solution, especially if it is close to the one in that how-to doc.
    Thanks in advance.
    Luc

    The following is the first collection solutin I've tried:
    htmldb_collection.create_or_truncate_collection('TEMP_TABLE');
    for i in 1..p_row_num loop -- Loop on the whole form rows
    if (htmldb_application.g_f01(i) is not null) or (htmldb_application.g_f05(i) <> 0)
    --If either of them has some input values, the row should be saved into the colleciton.
    then
    htmldb_collection.add_member(
    p_collection_name => 'TEMP_TABLE',
    p_c001 => htmldb_application.g_f01(i),
    p_c002 => htmldb_application.g_f03(i),
    p_c003 => htmldb_application.g_f04(i),
    p_c004 => htmldb_application.g_f05(i),
    p_c005 => htmldb_application.g_f06(i),
    p_c006 => htmldb_application.g_f08(i)
    end if;
    end loop;
    Some of columns have null values, but I don't think that's the reason. Because once I clicked all the check boxes, there would be no error no matter what values were in other columns.
    Another issue would be extract the values FROM the collection, which has been tried because I had problem to store the data into the collection. I used "decode" functions inside the SQL to build the tabular form. I am not sure whether it will be the same as a regular SQL for a tabular form, like the example in the How-to doc.
    Also I didn't use the checksum, for it is not an issue at the current stage. I am not sure whether that's the reason which caused the NO DATA FOUND error.

  • Submitting the value of an item with session state

    Hi,
    I've a Master / Detail Form on different pages, like master report page no.19, master form page no. 20 and detail form page no. 21. I've created this form using Form, master detail form wizard. I've set deptid as a primary key in master, and foreign key in details table. In page 21, i've set the source for deptid, source used : Always, replacing any existing value in session state, source type : Item (application or page item name), source value : P20_DEPTID. While executing the form deptid is showing the value, but, while submitting of the form, it's not saving in the table. What will be the problem??
    Thanks and Regards,
    Sudha.

    Sudha,
    OK.
    Go to the pagedefintion in page 20, click on the wordt report (of your master form).
    You will get a new screen.
    Click on the pencil-icon of your column.
    Again a new screen.
    Select the six tab (it's called LINK).
    Enter item-name and value something like :p21_dept_id and #DEPT_ID#
    where P21_dept_id is the item of the form for the dept_id
    Hope this helps.
    Leo

  • Detecting change to session state

    Apex 4.0.2
    Say I have a form page with a bunch of items. An On Load process populates them using SELECT...INTO. When the page is submitted, is there a way I can identify which page items have changed so they can be recorded in a database table. A generic solution instead of the brute-force way of duplicating all page items as hidden items and comparing values during processing.
    When a page is run in debug mode, I see messages like Saving same value P1_FOO or when viewing session state using the Dev toolbar, there is a status column with Inserted or Updated so it would appear that the Apex engine does track changes to page items beteween the time they are rendered and processed.
    Any ideas? Thanks

    Tony & Jari - Yes, using collections would seem like the best option. It is not as difficult as I had imagined. Something like
    apex_collection.create_or_truncate_collection('FORM_DATA');
    for c1 in (select ... from apex_application_page_items
    where application_id=:APP_ID and page_id=:APP_PAGE_ID and item_name in (...))
    loop
      apex_collection.add_member('FORM_DATA',c1.item_name,v(c1.item_name));
    end loop; can be used to populate the collection in a On Load process.
    An After Submit process would compare v('item_name') to the corresponding value in the collection and do what it needs to do.
    John - Thanks, that would work too I guess.
    Thanks all

  • Corrupt Session State? - Apex form posts text value as Null

    Recently I've discovered an issue with our Apex installation in which any value chosen as a source for a text field ends up being posted as a null to the database.
    We are running APEX version 3.2 within an Oracle 10.2.0.4 database using the Oracle HTTP Server from the 10g companion disk.
    At first glance, everything appears to function as expected; I have created a simple table called "oracle_sr" with 2 columns both not null:
    SQL> desc capacity.oracle_sr
    Name Null? Type
    ORACLE_SR_ID NOT NULL NUMBER
    TIMESTAMP NOT NULL DATE
    Within APEX the form wizard was used to create a form on this table.
    After executing the pages and entering a value for the timestamp field I can create records without issue.
    The issue arises when I choose a source value for the timestamp field.
    Any of the source options result in the same error (including a static value) so I will focus on the SQL Query for the source as:
    select sysdate from dual;
    This should substitute the system date within the timestamp text field when the page is executed.
    As expected, the value appears in the text box but when I submit the form to create the record I receive the error:
    ORA-01400: cannot insert NULL into ("CAPACITY"."ORACLE_SR"."TIMESTAMP")
    I have been working with APEX for quite some time and have successfully used this technique in many applications but just started to see this error over the past few days. What is particularly odd about this message is that default "not null" validations created by the form wizard sees the timestamp filed as having a value. The session state information included below is reporting a value yet the database is throwing the ORA-01400.
    Has anyone experienced a similar issue? I've spent a fair amount of time trying to research this issue but cannot seem to find any similar posts.
    I have included the debug output from my test page, from what I can see, there does seem to be a value associated with the timestamp filed:
    0.00: A C C E P T: Request="CREATE"
    0.00: Metadata: Fetch application definition and shortcuts
    0.00: NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en-us
    0.00: alter session set nls_language="AMERICAN"
    0.00: alter session set nls_territory="AMERICA"
    0.00: NLS: CSV charset=WE8MSWIN1252
    0.00: ...NLS: Set Decimal separator="."
    0.00: ...NLS: Set NLS Group separator=","
    0.00: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -06:00
    0.01: Setting NLS_DATE_FORMAT to application date format: DD-MON-RR
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: Fetch session state from database
    0.01: ...Check session 2303701116904676 owner
    0.01: Setting NLS_DATE_FORMAT to application date format: DD-MON-RR
    0.02: ...NLS: Set date format="DD-MON-RR"
    0.02: ...Check for session expiration:
    0.02: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.02: Session: Fetch session header information
    0.02: ...Metadata: Fetch page attributes for application 109, page 50
    0.02: ...Validate item page affinity.
    0.02: ...Validate hidden_protected items.
    0.03: ...Check authorization security schemes
    0.03: Session State: Save form items and p_arg_values
    0.03: *...Session State: Save Item "P50_ORACLE_SR_ID" newValue="" "escape_on_input="N"*0.03: *...Session State: Save Item "P50_TIMESTAMP" newValue="26-MAY-09" "escape_on_input="N"*
    0.03: ...Session State: Save "P0_CURRENT_PERSONNEL_ID" - saving same value: "1"
    0.03: ...Session State: Save "P0_OFFSET" - saving same value: "0"
    0.03: ...Session State: Save "P0_ACTIVE_WEEK" - saving same value: "24-MAY-09"
    0.03: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: Branch point: BEFORE_COMPUTATION
    0.03: Computation point: AFTER_SUBMIT
    0.03: Tabs: Perform Branching for Tab Requests
    0.03: Branch point: BEFORE_VALIDATION
    0.03: Perform validations:
    0.03: ...Item Not Null Validation: P50_TIMESTAMP
    0.04: Branch point: BEFORE_PROCESSING
    0.04: Processing point: AFTER_SUBMIT
    0.04: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select ORACLE_SR_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P50_ORACLE_SR_ID := get_pk; end;
    0.04: ...*Session State: Saved Item "P50_ORACLE_SR_ID" New Value="6"*
    0.04: ...Process "Process Row of ORACLE_SR": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:ORACLE_SR:P50_ORACLE_SR_ID:ORACLE_SR_ID|IUD
    0.04: Show ERROR page...
    0.04: Performing rollback...
    ORA-01400: cannot insert NULL into ("CAPACITY"."ORACLE_SR"."TIMESTAMP")
    Unable to process row of table ORACLE_SR.
    Return to application.
    Any thoughts would be appreciated.
    Thank you,
    Justin.

    If you changed the Source Type of an item from Database Column to something else, then it cannot participate in the Automated Row Fetch/Automatic Row Processing (DML) choreography. You should leave the Source Type as it was and change the item's Default Value to populate it when the ARF process fetches a null for the column.
    Scott

  • Application Items/Session State Values and Page Branching

    I have users coming into a specific page in my application, passing in a value on the url that sets the value of an application item, where a validation routine occurs. If their session validates, I want to send them to one page, if it does not, I want to send them to a login error page.
    During validation, I am setting the values of several application items so that these values can be saved and used throughout their session. The values appear to be setting correctly. I am concerned that setting the application items may not be limiting these values to a particular session. So, I have also tried setting the setting session state variables with code like:
    apex_util.set_session_state ('F203_REQ', vReqID);
    I found it curious though when I ran this page, not trying to branch so I could check session state, these values showed up as being application items and I saw nothing under session variables.
    The problem I am having is that once validated I don't know how to branch to these other pages. I have tried adding some javascript in the header to force a page submit so that I could use a branch setup on the page. However, when it comes time to evaluate the branches (it's using one of the application item values I set earlier), I'm getting an error that no branch has been provided. Further research suggests the application item values are being cleared on the page submit.
    So, (1) I either need to know how to preserve those values on submit so the page branch works or (2) I need to branch to the new page without using a page submit and instead doing that in a some code (assuming submit is clearing application item values). I have not been able to find an example of how to do this in code. If there is a way to do this in code, will the application item or session state variable values be retained? I will need these values to be available to the user throughout their session.
    Thanks for the help,
    Steve

    Steve,
    I am concerned that setting the application items may not be limiting these values to a particular session.They are set in the current session only.
    It is hard to know what you are doing exactly without seeing it. If you set up an example on apex.oracle.com we could could address one specific question at at time.
    Scott

  • Setting session state post-authentication

    Hi all,
    This application uses DATABASE ACCOUNT authentication, and has a post-authentication process that sets a few application items using code such as
    apex_util.set_session_state('F_MY_ITEM', v_my_value);These items are used to secure certain tab options within the application.
    The post-authentication PL/SQL works fine, I can't see anything wrong the the logic. I've debugged it and I know the values are being set. I'm checking the value of session state straight after using v('F_MY_ITEM'), along with checking my session ID matches up - everything seems ok there.
    The issue is that when I log in, the session state is not set for those items - even though the post-auth process is called with no errors raised. Apex debug states
    ... Session State: Save "MY_ITEM" - saving same value "Y"If I log out, then log in (without closing browser tab), the values are now set as expected (visual confirmation using conditionally displayed tabs, and of course checking session state from developer toolbar)
    Notably, Debug states something slightly different
    ... Session State: Save item "MY_ITEM" newValue="Y" escape_on_input="Y"There are a few other differences with the debug output, this this seems the most pertinent.
    The only difference I've been able to track down is if I'm logged into the application builder in the same browser.
    If I attempt to log in with a freshly opened browser, navigate directly to application URL, the behaviour works as expected. Tabs appear as if items are set.
    Could the fact I'm authenticated in the application builder be messing with session state behaviour?
    This is with Apex 4.0.2.00.07; agnostic to browser (IE/FF/Chrome); 11gr2
    Cheers,
    Scott

    I did consider this because I experienced the same thing with page processes.
    However, in this case my post-auth function is within a package and I don't use bind variables.
    I was essentially doing this in my package:
    apex_util.set_session_state('F_MY_ITEM', 'Y');
    my_log_proc(v('F_MY_ITEM'));And seeing Y in the debug log, yet once on my home page, viewing session state I see F_MY_ITEM as empty - unless in the scenario I described.
    It's not a showstopper since the users won't be logged in to the application builder, but it would be nice to know the cause.

  • ??? On Session State

    Background info:
    I have a field that could have two different types of input, one would be numeric (such as a PK) the other input to it would be text. To ensure the Automated Row Fetch always pulls the PK properly I am using a computation ON LOAD to turn the text into numeric so that when the Automatic Page Load runs it will always pull from the database based on the PK.
    This part is working properly the problem is that I have an item that is a select list and it unforunately has an dynamic LOV with a query of select a,b from table_xyz where value = :session_state_of_pk
    This is causing me a problem because it is referencing the "text value" and not the numeric value. Even though when I change my page view to "Events" the page rendering shows computations before Items. I even did a Pl/sql process ON LOAD to insert the :session_state value to a debug table.
    So my question is ... If the pl/sql on load process is holding the correct value then why is the LOV of a page item not using the correct value??
    This is the error I get on the page Item that is an LOV:Error: ORA-01722: invalid number performing List of Values query

    Vikas, I have done this and here are the results:
    .01: S H O W: application="110" page="103" workspace="" request="" session="6865688852817169"
    0.01: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: NLS: CSV charset=WE8MSWIN1252
    0.02: ...NLS: Set Decimal separator="."
    0.02: ...NLS: Set NLS Group separator=","
    0.02: ...NLS: Set date format="DD-MON-RR"
    0.02: ...Setting session time_zone to dbtimezone
    0.02: NLS: Language=en-us
    0.02: Application 110, Authentication: CUSTOM2, Page Template: 724212235889446
    0.02: ...Supplied session ID can be used
    0.02: ...Application session: 6865688852817169, user=JRP22
    0.02: ...Determine if user "JRP22" workspace "1786101047996118" can develop application "110" in workspace "1786101047996118"
    0.03: Session: Fetch session header information
    <b>0.03: Saving g_arg_names=P103_IP_ID and g_arg_values=077.243
    0.03: ...Session State: Save Item "P103_IP_ID" newValue="077.243" </b<"escape_on_input="N"
    0.03: ...Metadata: Fetch page attributes for application 110, page 103
    0.03: Fetch session state from database
    0.04: Branch point: BEFORE_HEADER
    0.04: Fetch application meta data
    0.04: Authorization Check: "6961000503551770" User: "JRP22" Component: "PAGE"
    0.06: Computation point: BEFORE_HEADER
    <b>0.06: ...Perform computation of item: P103_IP_ID, type=QUERY
    0.06: ...P103_IP_ID=select ip_id from IP where IP = :P103_IP_ID;
    0.06: ...Session State: Saved Item "P103_IP_ID" New Value="32"
    0.06: Processing point: BEFORE_HEADER
    0.06: ...Process "TEST DB INSERT SESSION STATE P103_IP_ID": PLSQL (BEFORE_HEADER) insert into t (col1,col2,tstamp) values ('p395',:p103_ip_id,systimestamp);</b>
    0.08: Show page template header
    0.09: Computation point: AFTER_HEADER
    0.09: Processing point: AFTER_HEADER
    <b>0.09: ...Process "Fetch Row for IP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:IP:P103_IP_ID:IP_ID
    </b>0.10: ...Process "Fetch DNS_NAME To Buffer": PLSQL (AFTER_HEADER) :P103_DNS_NAME_BUFFER := :P103_DNS_NAME;
    0.11: ...Session State: Save Item "P103_DNS_NAME_BUFFER" newValue="3657" "escape_on_input="N"
    0.11: ...Process "Get Next or Previous Primary Key Value": GET_NEXT_OR_PREV_PK (AFTER_HEADER) #OWNER#:IP:IP_ID::IP::P103_IP_ID:P103_IP_ID_NEXT:P103_IP_ID_PREV::::P103_IP_ID_COUNT:
    0.13: ...Session State: Save Item "P103_IP_ID_NEXT" newValue="33" "escape_on_input="N"
    0.13: ...Session State: Save Item "P103_IP_ID_PREV" newValue="31" "escape_on_input="N"
    0.14: ...Session State: Save Item "P103_IP_ID_COUNT" newValue="32 of 3434" "escape_on_input="N"
    0.14: ...Process "Fetch MAC_ADDRESS": PLSQL (AFTER_HEADER) select mac_address into :P103_MAC_ADDRESS from mac_address where IP_ID = :P103_IP_ID;
    0.15: ...Session State: Save Item "P103_MAC_ADDRESS" newValue="00-16-3G-33-25-33" "escape_on_input="Y"
    0.15: ...Process "Fetch Container_Type": PLSQL (AFTER_HEADER) select container_type into :P103_CONTAINER_TYPE from container_type where container_type_id = :P103_CONTAINER_TYPE_ID;
    0.16: ...Session State: Save Item "P103_CONTAINER_TYPE" newValue="BASE_UNIT" "escape_on_input="Y"
    0.16: ...Process "Populate Hidden Assign value": PLSQL (AFTER_HEADER) :P103_ASSIGNED_BUFFER := :P103_ASSIGNED;
    0.16: ...Session State: Save Item "P103_ASSIGNED_BUFFER" newValue="Y" "escape_on_input="N"
    0.16: Authorization Check: "4769021032313739" User: "JRP22" Component: "tab"
    From Session State after the page has loaded:
    Application Page Item Name Display Item Value Status
    110 103 P103_IP_ID Hidden 32 U
    Vikas: From the debug info you can the value comes in with the the IP ( I have removed the first two octets from the debug information) "Saving g_arg_names=P103_IP_ID and g_arg_values=077.243"
    A few steps later a computation is performed and the IP is chagned to an IP_ID which the value is 32, this is correct at this point.. Following that there is a pl/sql insert of :P103_IP_ID and that value is 32 inside the db table.
    Here is what it looks like on the screen:
    <b>Any ideas why the Select List LOV does not like this value?</b>
    Here is the actual LOV query:
    select dns_name,dns_name_id from dns_name where ip_id = :p103_ip_id
    Message was edited by:
    Justin P

  • Session state protection violation

    I turned on the session state protection on my application, the setting for Application Item, Page Data Entry Item and page display-only item are "checksum-required, application level". I want the URL to be shared by user in different sessions (for example bookmark). when I open two browsers (IE, Firefox) and login as same user, I copied/pasted url from one browser to another and received "Session state protection violation: This may be caused by manual alteration of a URL containing a checksum or by using a link with an incorrect or missing checksum."
    Did I misunderstand the intent usage of this feature? I also noticed that checksum generated by the system remains the same no matter what checksum level I set (application, user, session).
    I am running APEX 3.1.0.00.32.

    Cheng-Lu,
    I didn't forget you, this was a very difficult problem to debug.
    I think I have a workaround for you. I added a page process to your login page named "fix deep link item". This restores the value of FSP_AFTER_LOGIN_URL that gets passed to this login page and is supposed to be immediately saved in session state. Due to a bug, this value was getting truncated to "f" before it could be saved. The new page process looks at the current URL and uses the value there which is still intact and saves that value in session state. I tested it with your applications. Please let me know if this works. We'll make a proper fix in the 3.2 release.
    So this was not a problem with session state protection but in the "f" procedure which parses argument names/argument values in f?p URLs. This gets tripped up when an argument value contains a pattern like &cs= which is first treated as an argument to the orignal "f" call and therefore is never seen as an argument value in the list of arguments.
    I have some other observations about your applications. I see that they have code in the page sentry function attribute of the authentication scheme. The code you have in there is completely unnecessary and could actually make the application less secure. You should leave this attribute empty and let the default (built-in) page sentry do all the work.
    Scott

  • 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.

Maybe you are looking for

  • Idocs statsu 51 Application document not posted

    Hi All, We are having an issue with orders having large number of line items in which Shipping confirmation Idocs coming from warehouse are going to status 51 (Application document not posted) when we look at the status record it shows "Object reques

  • Message Expiration @ EDN

    Hi, I have been leveraging EDN for publish-subscribe pattern implementation. In my business use-case there is one publisher and 3 subscriber. I am looking for little information around EDN. 1.     What is message expiration time at EDN, in case of su

  • SignTool Error when installing app

    When trying to install my locally published app, I receive the following error: SignTool Error: File not found: C:\Users\me\AppData\Local\Temp\MyApp.appx I've tried the Create an appx file for sharing option, but get a similar error. How can I get th

  • People cannot hear me!

    Not allways, but often when I make or receive a call, the person on the other end cannot hear me. I can hear them but it is as if the microphone is not working

  • How to update ios on iphone 3

    how can I update the ios on my iphone 3