Solved

How to make separated sessions pear each authenticated folder ?

Posted on 2009-07-01
3
175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 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