Solved

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

Posted on 2013-01-24
5
336 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 83

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 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