Solved

Why does my webpage redirect to another page automatically after login?

Posted on 2013-01-24
5
324 Views
Last Modified: 2013-01-29
Hi All,
i installed our website E on our server A. it works fine on that server. but when i tried to access it from my machine (note: not server A ), i had the following issues:
1. load the login page --> works fine
2. key in my credential and click LogIn button--> it automatically jumps to the default page of our public website O

what i expected is: after login, it should go to page C under website E.
Note: website E is the subwebsite of website O

in Login page:
protected void bLogin_Click(object sender, ImageClickEventArgs e)
    {
        if (!Page.IsValid)
            return;

        var user = WebUser.getByEmail(tbUsername.Text.Trim());
        if (user != null)
        {
            if (user.VerifyPassword(tbPassword.Text, true))
            {
                // store the user object so we can reference it on pages.
                Session["USER"] = user;

                // prevent multiple login by the same user (see Global.asax)
                Application["SessionID " + user.Id] = this.Session.SessionID;
               
//this is where the login page should go to. it goes to next page C when running on server A locally. but jumps to public website O when testing it on my machine                                 System.Web.Security.FormsAuthentication.RedirectFromLoginPage(user.Id.ToString(), false);
               
            }
        }
    }
******************************
web.config:

<authentication mode="Forms">
      <forms loginUrl="~/login.aspx" timeout="20" defaultUrl="~/Default.aspx" />
    </authentication>
    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>

**********************

Can anyone please point me to the right direction?

thanks heaps
0
Comment
Question by:viola123
  • 4
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38817081
The simple answer is that you are probably telling it to.  It will probably be in an absolute URL like "http://www.publicsite.com/" or in a 'basehref' line in your HTML.
0
 
LVL 6

Author Comment

by:viola123
ID: 38817248
Hi,
in login.aspx, when you click Logo, it will redirect to www.publicWebsiteO.com.
Could you give me more details?

thanks
regards
0
 
LVL 6

Author Comment

by:viola123
ID: 38817262
Hi,
Please note it works fine when testing on the Server A itself.

thanks
0
 
LVL 6

Accepted Solution

by:
viola123 earned 0 total points
ID: 38817426
Hi,
i figured out. it was case sensitive issue. when i access it via http://aaa/eee/login.aspx, it won't work. because it should be http://aaa/EEE/login.aspx. I changed the settings of Apache server to ignore this issue.

thanks
regards
0
 
LVL 6

Author Closing Comment

by:viola123
ID: 38830390
i solved it.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now