Click here to Skip to main content
13,044,543 members (60,268 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a funny issue with my c# website. The problem only comes when i upload the solution online, it just works fine when I am running on local machine.

Basically, i have a normal login page where I take username and password via text boxes, match it against the db and upon validity, I set up some session variables
and navigate user to default.aspx page.

On this default.aspx page under
event, I have following code

if (!IsPostBack)
            if ((Session["user_in"] != "Y"))

And on this default.aspx page, I am reading from db and writing to db.

But annoyingly after a few postback, i get signed out to

And the only code on the page that does that is under if condition in page_load event, meaning that it cannot find the value of

This only happens when i upload solution to the server, local machine doesn't behave that way.

Any ideas, help please?
Posted 26-Feb-13 1:27am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

A few things to look into:

1) Session Timeout - From your question, I am guessing this isn't a problem for you. Still just make sure you have required session timeout set in your web.config file.
2) Are you abandoning your session somewhere? Does this happen on a particular page or it happens randomly on any page?
3) Do you have a logging in place? What have you done to deal with unhandled exceptions? You have logs, you should check them out if there is something relevant. You should also check the event viewer on the server. It usually logs unhandled exceptions as well.

These are just a way to narrow down your problem. Start with them and let us know if you have any success.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100