Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-01-24
5
Medium Priority
?
341 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 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