4 Replies Latest reply: Jul 24, 2013 12:50 PM by Ingenio RSS

    keep item value after &LOGOUT_URL.  is called

    Ingenio

      Hi there

      I need to keep the value of the item after I click logout url.

      When logout is called, it takes me to the page 1 but i need the item P1_SCHEMA to keep its value before i logout,

      is it possible?

       

      apex 4.2

      database EE 11.2

       

      thanks.

        • 1. Re: keep item value after &LOGOUT_URL.  is called
          jrimblas

          You could save the value in a cookie and read it again on Page 1 if the value is null. 

          See a standard Login Page 101 to see how the cookies are read and set.  See the "Get Username Cookie" and "Set Username Cookie" processes.

           

          Thanks

          -Jorge

          • 2. Re: keep item value after &LOGOUT_URL.  is called
            Ingenio

            I did the following to resolve my need.

             

            -created page 102

            -changed the navigation bar entry settings to "redirect to page 102"

            -created on load process on page 102 as to create the coockie as follows

              begin 

                  owa_util.mime_header('text/html', FALSE);      

                  owa_cookie.send( 

                      name=>'SCHID_COOKIE', 

                      value=>'&SCHID.', 

                      expires => sysdate + 1); 

                  apex_application.g_unrecoverable_error := true; 

                  owa_util.redirect_url('&LOGOUT_URL.');

            exception when others then null; 

            end;

            --

            so page 102 creates the coockie ant sets the value of the application item, then goes to &logout_url. automatically

             

            - createn on load process on page 1 (default home page) to read the coockie value as follows

              DECLARE 

               cookie  OWA_COOKIE.cookie;   

              BEGIN 

                cookie := OWA_COOKIE.get('SCHID_COOKIE'); 

                  if cookie.vals.First IS not NULL then  

                    :SCHID := cookie.vals(1); 

               end if;  

            END;

             

             

            now I have a question... Do i need to owa_cookie.remove() somewhere?

            thanks!

            • 3. Re: keep item value after &LOGOUT_URL.  is called
              jrimblas

              Ingenio,

              Sorry, for some reason I didn't see an email for this.

               

              It depends on your requirement, but no, probably not.  You could also specify an expiration for the cookie so that it goes away on it's own after X time. The browser will do that for you.

               

              Thanks

              -Jorge

               

              PS. Could I also recommend you flag the posters answers as useful or correct so that they get the incentive of the points?  I only mention this because you used my suggestion, but flagged your answer as the correct one. 

              • 4. Re: keep item value after &LOGOUT_URL.  is called
                Ingenio

                I understand, actually I set to expire tomorrow...

                expires => sysdate + 1);

                 

                thank you  jrimblas..