How to maintain state of a User Logged In.

Posted by Vasanthmvp under ASP.NET on 8/15/2012 | Points: 10 | Views : 1736 | Status : [Member] | Replies : 1
I have an application that resembles a basic Log in Page template.
I had set two users with roles one as Moderator and the other as Administrator.
I have some secure links as well as admin restricted pages in my application.
Initially, i am logging in as moderator and visiting through links restricted only to admin, which redirects me to the Log in page to get logged in as Administrator.
In case, if am logging out now, the only administrator account that i had logged in through i.e later, should only get logged out and the previous user should be in the same state, but both the users are getting out of their log in state.
Eg: Just as in windows operating system, we maintain a system while installing any software in a normal user account, it asks us the permissions of administrator account & its password. Its checks it, set the permission & get backs to its own state of normal user account.

I would appreciate for the response in detail.

Thank You.

Awesome Coding !! :)


Posted by: Johnbhatt on: 8/19/2012 [Member] Starter | Points: 25

I think you are doing the task in some confusing process.

If you have just authenticate Moderator as administrator. then Just use a popup form or textbox to enter the password of Administrator. If that matches with Database allow Moderator to visit link else redirect to same Position.

Same as Validation in Form. If form field is Empty, return false else return true.

John Bhatt
Glad to Know, Free to Share.....

Vasanthmvp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response