[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2013-01-24
5
Medium Priority
?
342 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 84

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month20 days, 4 hours left to enroll

872 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