Two type of login in an application

I need to implement two type of login in an application.

The scenario is pretty much like this.

  1. There will be a kind of user who can go anywhere inside the web application.

  2. There will be a kind of user who can go to some places inside the web application with their login username and password.

Now problem that I am facing to enable their profile is that they are contracting with each other.

Like if the 2nd kind of user is logged in and he goes to the login page of 1st kind of user then its redirecting into an infinite loop.

I am using CUserIdentity. Please give me some suggestion about this. How to avoid such conflict. I want

When 1st kind of user is logged in then they will not be asked about any login in any condition.

But when 2nd kind of user will be logged in then if he goes to the login page of 1st kind user, he will be prompted to do login and if he does so then the session of 2nd kind will be destroed and 1st kind of user’s session will start.

Please show me some way… :blink: