merge two asp.net website?

  • Thread starter Thread starter mark
  • Start date Start date
M

mark

How to merge two asp.net website? they will use one request.isauthenticated
attribute.

It looks redirect URL from one project to another will make
request.isauthyenticated change to false. (if it's true before redirect)
 
mark said:
How to merge two asp.net website? they will use one request.isauthenticated
attribute.

It looks redirect URL from one project to another will make
request.isauthyenticated change to false. (if it's true before redirect)

What is the Domain of the cookies you're setting? To work on localhost, it
should be String.Empty.
 
Natty Gur said:
Hi,

Every web application assigns to dedicate App Domain. CLR don't let one
App. Domain to access other App. Domains memory space (as the operating
system does with process). Request is part of the application so every
request represent other session that is part of different application. I
don't think that you can share isauthyenticated because setting it on
one web application got nothing to do with other web applications.

If both web applications use Forms authentication, and if they both use the
same cookie name, domain name and path, and if they both have the same
<machineKey> settings, then being authenticated in one application will
imply being authenticated in the other. This will give the affect of their
sharing IsAuthenticated.
 
Nick said:
John may be right. My two projects used to share the IsAuthenticated
without problem. But it suddenly didn't work since this week.

Now, the Request.IsAuthenticated is true in the my code after
authenticating, after redirect to URL in another project which also sets
forms authentication in web.config (authenticate="forms" deny ? users,
etc). The IsAuthenticated changed to false right after redirecting to
the URL.

Should I copy web.config of my first project to overwrite the second one
instead of modify the "authenticate" and "deny"?

Nick,

Don't change your web.config without knowing why.

Forms authentication problems almost always come down to cookie problems. So
you'll want to track the cookie.

I suggest turning on tracing in both projects:

<trace enabled="true" requestLimit="100" pageOutput="false"
traceMode="SortByTime" localOnly="true" />

Then, reproduce the problem and then look at http://localhost/app1/trace.axd
and http://localhost/app2/trace.axd. In particular, go through the requests
and check the Cookies collection for each step.

If you find that the cookie from app1 never gets to app2, check things like
the cookie name, domain, path and expiration for reasons why it wouldn't get
there.
 
Back
Top