22
Views
3
Comments
Infinite loop in concurrent login in multiple places
Question

Hello All,


Recently I was doing checking for multiple active user session in the system. But I ran into infinite loop when I login and also logout. Can anyone suggest any idea to resolve it?? Attached is the oml.


Thanks :)

DetailScreen.oml
2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Hi,

I can't publish your module to confirm this because of missing references, but these sorts of loops are usually caused by page permissions chaining you into inaccessible pages. Here's my theory:

 - the default entry point for your application is the Movies page (Entry1 connects to it);

 - your Movies page demands you have the AAdmin permission in order to access it:

 - the login page preparation checks to see if you are logged in: it's possible to be logged in but not an AAdmin:

If you're logged in, the ExternalURL sends you to the home screen of your application which is Movies. If you don't have permissions, this triggers an Exception and sends you back to the Login screen, and the cycle repeats.

You can try setting up debug breakpoints around these parts of your module to confirm this. The Login screen preparation, the Movies screen preparation, and the OnException handler are good candidates and possibly all involved with this.

2020-09-10 09-11-19
J u n i o r

Afonso Carvalho wrote:

Hi,

I can't publish your module to confirm this because of missing references, but these sorts of loops are usually caused by page permissions chaining you into inaccessible pages. Here's my theory:

 - the default entry point for your application is the Movies page (Entry1 connects to it);

 - your Movies page demands you have the AAdmin permission in order to access it:

 - the login page preparation checks to see if you are logged in: it's possible to be logged in but not an AAdmin:

If you're logged in, the ExternalURL sends you to the home screen of your application which is Movies. If you don't have permissions, this triggers an Exception and sends you back to the Login screen, and the cycle repeats.

You can try setting up debug breakpoints around these parts of your module to confirm this. The Login screen preparation, the Movies screen preparation, and the OnException handler are good candidates and possibly all involved with this.

 Hi Afonso,

I am not sure if I understand your suggestion clearly. I tried adding checking for AAAdmin role in the Login's preparation but it doesn't work.


Is it something goes wrong with my onSessionStart event and OnBeginWebRequest event?

 

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

I'm looking at the OnBeginWebRequest and there are some branches that cause you to logout. It could certainly be related.

This is all just theory though. Have you tried debugging before you trigger one of these infinite loops? You'd be able to follow the code execution step-by-step so it should prove helpful in figuring out what's going wrong.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.