Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms Authentication for Different Subdirectories

Status
Not open for further replies.

JabbaTheNut

Programmer
Jul 29, 2002
176
US
My website is structured as follows:

/localhost
...default.aspx
...web.config
...otherfiles.aspx
.../MySubDir
......default.aspx
......otherfiles.aspx

The web.config located in my root directory looks like the following:

<configuration>
....<system.web>
........<authentication mode=&quot;Forms&quot;>
............<forms name=&quot;MyAuth&quot; loginUrl=&quot;MySubDir/Login.aspx&quot; protection=&quot;All&quot; timeout=&quot;60&quot; path=&quot;/&quot; />
........</authentication>
....</system.web>

....<location path=&quot;MySubDir&quot;>
........<system.web>
............<authorization>
................<deny users=&quot;?&quot; />
............</authorization>
........</system.web>
....</location>
</configuration>

This configuration stores identity information in the &quot;MyAuth&quot; cookie and sends unauthorized users who try to enter the &quot;MySubDir&quot; subdirectory to the login page located at &quot;MySubDir/Login.aspx&quot;.

My problem is as follows:

I want to add another subdirectory called &quot;MyOtherSubDir&quot;. I want to use a different identity cookie such as &quot;MyOtherAuth&quot; and I want to send unauthorized users who try to enter &quot;MyOtherSubDir&quot; to a different login page located at &quot;MyOtherSubDir/Login.aspx&quot;.

How would I modify the above web.config file to achieve my objective. Any help would be appreciated. Thanks :) Game Over, Man!
 
put another web.config file in that directory w/ the settings you want for that directory.

it'll override the other's settings, much like the other's overrides machine.config

:)
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top