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.