Solved

How to make separated sessions pear each authenticated folder ?

Posted on 2009-07-01
3
172 Views
Last Modified: 2013-11-07
guru_sami:

If I log in to "admin" subfolder I can enter to "manager" subfolder without been asked for validation.
I wonder if would be possible that users logs in to admin folder can´t do it to manager folder and vice versa.

Thanks.
0
Comment
Question by:dimensionav
  • 2
3 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 24758834
Yes....that was my fear which I thought you are dealing with by putting Session["Area"] or something like that.
1: Add Roles to userContext ( http://www.dotnetfunda.com/articles/article141.aspx )
Then your web.config location should change like below:
<location path="admin">
            <system.web>
                  <authorization>
                                                                                      <allow roles="Admin"
                        <deny users="*"/>
                  </authorization>
            </system.web>
      </location>

<location path="manager">
            <system.web>
                  <authorization>
                                                                                      <allow roles="Manager"
                        <deny users="*"/>
                  </authorization>
            </system.web>
      </location>

2: Store user Role in Session Variable and on each page check if user belong to particular role, this might become more tricky.
0
 
LVL 41

Assisted Solution

by:guru_sami
guru_sami earned 500 total points
ID: 24758866
Oh yes...if you are using asp.net membership provider for authentication then you can start using RolesProvider as well. In that case discard the previous reference link I provided and look at roles tutorials here:
http://www.asp.net/learn/security/
0
 

Author Comment

by:dimensionav
ID: 24777017
I´m not an expert on C# and a think this is gonna take some time so I´ll try and I´ll let you know any issue in a related question.

Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question