FormsAuthentication.RedirectFromLoginPage problem

B

BoltonWolf

Hi,

I have a ASP.Net web site, that we sell as a module to our core
software, versions of this site are running fine on many servers,
however we are having problems with our latest installtion, and it's
got me scratching my head.

The problem is with FormsAuthentication.RedirectFromLoginPage, it's
running on a brand new Windows 2003 standard server. No matter what I
do I cannot log onto the web site. It's as if it's not writing cookies
or something.

When some one enters a user name and password it validates ok, telling
them if they've got it wrong, but if they enter the correct details,
and I call FormsAuthentication.RedirectFromLoginPage, all it does is
return to the Logon Page rather than redirecting them back to the
calling page.

If I copy all the files from this site to a different server, it works
fine. So I know it must be a setting I've missed on the server.

Does anybody have any ideas.

Many thanks in advance

Chris
 
R

recoil

Is the domain hard coded in the application?
Have you tried with multiple browsers?
Have you made sure the server's and client's time is properly synced?
Have you tried debugging it and seeing variables and cookies as they
are being set and then where they are upon the next page redirect
 
B

BoltonWolf

Is the domain hard coded in the application?
No, the site need to be flexible enought to be run from any domain
Have you tried with multiple browsers?
Only multiple instances of IE, as this is our target audience.
Have you made sure the server's and client's time is properly synced?
It doesn't work if I use the browser on the server, so this rules this
out.
Have you tried debugging it and seeing variables and cookies as they
are being set and then where they are upon the next page redirect?
I'm not sure how I debug the cookie when using FormsRedirect, but the
exact same site on a different server will work fine
 
R

recoil

That is why it "sounds" like
Cookie problem
Ultimately server side cookie problems usually come down to 2 things
#1 - somebody accidentally hard coded a domain into the code
#2 - You are working off of a subdomain and are not setting the cookie
up to handle this
#3 - Somebodys time is off sync
or either a very obsecure/strange configuration problem that I have
never rune across.

If you have debugging setup on your server then this is extremely easy.
You merely fire up vs.net with your project loaded. Put a breakpoint in
your forms authentication procedure and put a breakpoint on the
location it is redirected to.
Then you Step through it. As you step through it you add related
variables to your Watchwindow, such as username/password, The Cookies
collection. and you monitor and analyze the values as the page is
authenticated and as the page is redirected. This will usually clue you
in as to what the problem is and then you can begin a much more direct
line of attack
 
G

Guest

I had the same problem. When trying to login to a forms-authentication
protected site from IE, IE wouldn't redirect properly eventhough the user was
properly authenticated. However, accessing the site through Firefox worked
just fine. After some investigation it turned out that the date on the server
was a month behind. Once I corrected the date setting IE functioned properly.
I can only speculate that the cookie was seen as expired by IE becuase of the
date difference.

It's still seems rather odd that Firefox accepted it just fine and dandy
though.

Eric
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top