merge two asp.net website?

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)
 
J

John Saunders

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.
 
J

John Saunders

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.
 
J

John Saunders

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top