FormsAuthentication Redirection NOT WORKING!!

S

studen77

Thanks in advance to anyone who can help:)

Ok- I've got two different ASP.NET projects communication with each other;
one has its WEB.CONFIG file restricting anonymous users with the following
entry:
<authentication mode="Forms">
<forms loginUrl="OtherASPNETprojectname/login.aspx" name="whateverIwant"
path="/" protection="All" />
</authentication>
<authorization>
<deny users="?" />
</authorization>

The other project, which has the login.aspx page allows anonymous users and
uses Windows authentication. The login.aspx contains event-driven logic to
create the Authentication cookie:
FormsAuthentication.SetAuthCookie(txtUser.Text.Trim(),true);
Which it does so successfully **(however, the cookie is not named
"whateverIwant", as I specified in the web.config file in the first project,
but makes its own default name.**
It then gets the redirection URL with the formsauthentication.getRedirectUrl
method,
which it also does succesfully. The final line of code simply does a
Response.Redirect(redirectionurl);
to send it to the protected page with its cookie authentication;

WHAT'S DRIVING ME CRAZY IS THAT IT SIMPLY REFRESHES LOGIN.ASPX!!!!! IT
DOESN'T GO ANYWHERE!! I'VE REMOVED ANY ROUTER/FIREWALL HARDWARE/SOFTWARE AND
GAVE IT A DIRECTION CONNECTION TO THE INTERNET!! It does everything it
supposed to (acknowledging the correct username and password, creating the
cookie (albeit not in the name I specified), and produces the correct
redirection URL; IT JUST DOESN'T REDIRECT!!! IT HAS TO BE SOMETHING WITH
READING THE COOKIE ITSELF, OR I DON'T KNOW!!
**My servername also does not have any "_" characters in it, just plain text
letters**
 
P

Paul Glavich [MVP ASP.NET]

Not sure if I understand 100% but the 2 sites will effectively be
incompatible in terms of the authentication being used. If the cookies are
named differently, OR the site is on a different hostname, then they wont be
able to see each others auth cookie and no auth will occur. Have a look at
my article at http://aspalliance.com/553 which may help.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top