Velocity Reviews

Velocity Reviews (
-   ASP .Net (
-   -   Forms Authentication for multiple applications (

cab0san 02-11-2005 08:54 PM

Forms Authentication for multiple applications
I have several applications all on the same server. I would like them
to all use the same login page.


I have a login page located in the root of the same server:

None of these are virtual directories.

The web.config file for customers/ and suppliers/byregion/ looks like

<authentication mode="Forms">
<forms loginUrl="/login.aspx" name=".ASPXAUTH" timeout="30" path="/"
<deny users="?" />
<allow users="*" />

The web.config for the root web looks like this
<authentication mode="Forms">
<forms loginUrl="login.aspx" name=".ASPXAUTH" timeout="30" path="/"
<deny users="?" />
<allow users="*" />

Both apps are configured to allow anonymous in iis.

The login page code looks like this:

Dim tkt As FormsAuthenticationTicket
tkt = New FormsAuthenticationTicket(1, Me.txtUser.Text, DateTime.Now(),
DateTime.Now.AddMinutes(30), True, "<group info would go here>")
Dim cookiestr As String
cookiestr = FormsAuthentication.Encrypt(tkt)
Dim ck As HttpCookie
ck = New HttpCookie(".ASPXAUTH", cookiestr)
ck.Expires = tkt.Expiration
ck.Path = "/"
Dim strRedirect As String
strRedirect = Request("ReturnURL")

When I request a page in customers, like
http://server1/customers/app1.aspx, I am redirected to the login page
(good), bet when I click logon and run the above code, it just returns
to the login page again (bad).
The "ReturnURL" is correct, as I have seen in debug mode.

I'm guessing that app1 is rejecting my cookie, and returning me to the
login page again, but why?

I must be missing something simple. Any ideas?

cab0san 02-14-2005 02:55 PM

Re: Forms Authentication for multiple applications
If anyone is interested, I found the answer here.

Basically, it had to do with the "IsolateApps" setting and the machine
key settings in the machine.config file.

All times are GMT. The time now is 04:20 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.