GetExceptionURL() action parameters not saved

GetExceptionURL() action parameters not saved

  

Hi all, 

i have found one issue related with the GetExceptionURL() action, apparently when the exception (e.g. session timeout) occurs while clicking on a button or link the querystring parameters are lost and are not saved.

If it happens while entering or refreshing a page, the redirect keeps the original parameters, while if it happens on button click, the original parameters are lost.

In my scenario, i want to redirect the user to the same page when a session timeout occurrs or to a specific page while accessing using a direct internal page link after being redirected to login screen.

Is there any workarround for this? Any other way to get always with parameteres?


Thanks

Best regards

Hi,

When exception occurs in a flow, it Abort all the transactions. If you want to save your changes in DB even when Exception occur, you have to set Abort Transaction to No in AllException properties.


Hope this helps 

Manoj Ahirwar wrote:

Hi,

When exception occurs in a flow, it Abort all the transactions. If you want to save your changes in DB even when Exception occur, you have to set Abort Transaction to No in AllException properties.


Hope this helps 

Hi Manoj,


thanks for the feedback, maybe i didn't explain my self clear, what i'm trying to achieve is get the url of the screen where the exception occurs. To do this i'm using the GetExceptionUrl() system action, like i describe before, the problem is that sometimes the action only returns the screen Url without the querystring parameters and this way is useless in my scenario. 

I'm positive sure this is kind of a bug and it should always save the url + querystring as the exceptionUrl. My question is if there's a work arround for this? Any other way to get the exceptionUrl?

Thanks

Hi Severiano

Did you get a solution for this problem?

best regards

Where are you calling the getExceptionURL?

Hi


i m calling it in a OnException Action of a flow. I'm trying to catch a security exception, then i redirect to login page with the result of getExceptionURL() as "ReturnURL" page parameter. Tgis way user can login and be redirected to the page he lost session.



Hi António, 


sorry for the delay, unfortunately I didn't found a fix for this issue. What I did was handle the exception URL checking if the querystring parameters are present, and in some cases, if they aren't I simply redirect the user to the homepage instead of redirecting to the last URL without parameters that will cause an error again.

As I mentioned above, this issue only occurs for instance if you click on a button/link after the session as timeout, if instead of clicking a button you simply refresh the page then it will also throw session timeout error but the parameters are saved and available on the GetExceptionURL().


You need to set you GetExceptionURL() in the internal error page or invalid permissions (for example session timeout or if it redirects you to the login page) :p
it goes through those pages and afterwards to the loginpage.

Ofc based on your situation it might help you

Hi Severiano,

You need to evaluate carefully your use case. It seems that what you want is the URL of the last GET request executed. If that's the case, you can set a Session variable with the requested URL on every page, using the GetURL action from HTTPRequestHandler.

To avoid duplicating code, try using a web block and include it in the page Layout.

Web block Preparation should be something like

Just remember that after Login a new session is created and the session vars cleared, so you need to set the value to a local var of the Login screen.



Cheers,

Tiago.




Tiago Gafeira wrote:

Hi Severiano,

You need to evaluate carefully your use case. It seems that what you want is the URL of the last GET request executed. If that's the case, you can set a Session variable with the requested URL on every page, using the GetURL action from HTTPRequestHandler.

To avoid duplicating code, try using a web block and include it in the page Layout.

Web block Preparation should be something like

Just remember that after Login a new session is created and the session vars cleared, so you need to set the value to a local var of the Login screen.



Cheers,

Tiago.




Hi Tiago,

in my scenario and I think also António, this problems occurs after the session timeout, that means there's no point saving the last URL on a session var because it will be cleared. Right?

Thanks



Severiano Melo wrote:

Hi Tiago,

in my scenario and I think also António, this problems occurs after the session timeout, that means there's no point saving the last URL on a session var because it will be cleared. Right?

Thanks

Of course, my mistake. :)

If the described behavior is really important, you may save the info on the DB, caring about the small overhead in every screen.


To debug this issue, please try this two scenarios:

Scenario1 

1. Go to a page URL that uses querystring parameters

2. Force a session timeout

3. Click on any button on the page 

4. Security exception thrown (session timeout)

5. Check the GetExceptionURL() value - the querystring parameters were not saved and are not available


Scenario2 

1. Go to a the same page URL that uses querystring parameters

2. Force a session timeout

3. Instead of clicking in a button, simply refresh the page by hitting F5

4. Security exception thrown (session timeout)

5. Check the GetExceptionURL() value - the querystring parameters were saved and are available

 

Anyone else has this issue?


Severiano Melo wrote:

To debug this issue, please try this two scenarios:

Scenario1 

1. Go to a page URL that uses querystring parameters

2. Force a session timeout

3. Click on any button on the page 

4. Security exception thrown (session timeout)

5. Check the GetExceptionURL() value - the querystring parameters were not saved and are not available


Scenario2 

1. Go to a the same page URL that uses querystring parameters

2. Force a session timeout

3. Instead of clicking in a button, simply refresh the page by hitting F5

4. Security exception thrown (session timeout)

5. Check the GetExceptionURL() value - the querystring parameters were saved and are available

 

Anyone else has this issue?


If the button is defined as Submit it seems the kind oh behavior I would expect. Scenario 1 executes a POST where Scenario2 repeats the GET.


Tiago Gafeira wrote:

Severiano Melo wrote:

Hi Tiago,

in my scenario and I think also António, this problems occurs after the session timeout, that means there's no point saving the last URL on a session var because it will be cleared. Right?

Thanks

Of course, my mistake. :)

If the described behavior is really important, you may save the info on the DB, caring about the small overhead in every screen.


Hi Tiago,

yes indeed that was one of the options I considered, but in my case the app is 100% connected to Rest API and there's no DB.

Anyway thanks for the feedback  


Severiano Melo wrote:

Hi Tiago,

yes indeed that was one of the options I considered, but in my case the app is 100% connected to Rest API and there's no DB.

Anyway thanks for the feedback  


HTML5 Web Storage could also be a solution, with the advantage of working locally to the browser.


Tiago Gafeira wrote:

Severiano Melo wrote:

Hi Tiago,

yes indeed that was one of the options I considered, but in my case the app is 100% connected to Rest API and there's no DB.

Anyway thanks for the feedback  


HTML5 Web Storage could also be a solution, with the advantage of working locally to the browser.


Hi Tiago,

yes using HTML5 Web Storage or even store it in the browser cache would be a valid option. 

In any case, I would like to understand how the mechanism that stores the info consumed by the GetExceptionURL() works, also because it's an OS built-in function I would like to understand if there's a way to fix this on the platform. 

Thanks


Severiano Melo wrote:

Hi Tiago,

yes using HTML5 Web Storage or even store it in the browser cache would be a valid option. 

In any case, I would like to understand how the mechanism that stores the info consumed by the GetExceptionURL() works, also because it's an OS built-in function I would like to understand if there's a way to fix this on the platform. 

Thanks

I understand. Just don't know if it is a matter of fixing it or detailing the built-in action description. I'm also curious, but the answer should come from OutSystems. :)


Tiago Gafeira wrote:

Severiano Melo wrote:

Hi Tiago,

yes using HTML5 Web Storage or even store it in the browser cache would be a valid option. 

In any case, I would like to understand how the mechanism that stores the info consumed by the GetExceptionURL() works, also because it's an OS built-in function I would like to understand if there's a way to fix this on the platform. 

Thanks

I understand. Just don't know if it is a matter of fixing it or detailing the built-in action description. I'm also curious, but the answer should come from OutSystems. :)


Of course, 

I'll keep waiting for a detailed explanation for this issue from Outsystems.

Thanks for your time

;)