2 sites in IIS using formsauthetication - logout problems

S

Sarah

I have 2 sites in IIS. One as a subfolder of the webroot. One a virtual
directory. They have seperate web.config enabled formsauthetication.

The login screen validates the credentials and redirects:
FormsAuthentication.RedirectFromLoginPage(txtUserName, true);



I want to be able to persist both authentication cookies, but everytime I
log in to one site, I seem to lose authentication in the other, and when I
return to it, I am forced to log in again.

Am i doing something wrong here?



Thanks
 
M

Mr Newbie

Let me ask you a question.

Log on to any one of your two sites, and then go from that page to
Microsoft.com, then try to return to the site you logged onto, what happens
?
 
S

Sarah

Any ideas anyone?

It cannot be just me who has encountered this. Any pointers would be greatly
appreciated.

Thanks
 
M

Mr Newbie

Im not sure what the answer is really. But when I think about it, if you are
moving from one Authenticated session to another within the same browser
window, it will drop the cookie, it has to because you are disconnecting the
session to the first in facour of the second.

What Im not sure about is the relationship between the subfolder and its
root.

When you create a subfolder with its own web.config and change the
Authentication/Auhtorisation settings are you not simply creating a site
which just happens to be nested in the root of the parent site in which case
the experience you are having sounds as if it could be correct ? Have you
tried removing the Authentication section from the sub web.config ?

In essence, I thought that the seperate use of web.config in sub folders was
for the sole use of sub folder directory/resource persmissions, so that one
could further restrict the authorisation. It sounds like whatever setting
you have are forcing re-authentication.

Having said that, I am speculating here but trying to have a logical stab it
what may be the cause.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top