473,320 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Session_Start does not appear to fire

I have an ASPNET application that has worked correctly on couple of
servers. I have just deployed it to another server and cannot resolve
an issue.

It appears as if the Session_Start is not firing or session state is
not being maintained.

First lines of Session_Start:

string loc = "LoadSettings";
Session.Add("Session_Start_Loc", loc);

Inside Page_Load of first page to be displayed:

try
{
sessionerr = Session["Session_Start_Loc"].ToString();
lblExc.Text += " Session_Start_Loc=" + sessionerr;
}
catch(Exception ex1){lblExc.Text += " Exception in Session_Start_Loc="
+ex1;}

try
{
Session.Add("Test", "Test");
lblExc.Text += " Test=" + Session["Test"].ToString();
}
catch {lblExc.Text += " Test=Failed to retrieve";}

The result is: Exception in
Session_Start_Loc=System.NullReferenceException: Object reference not
set to an instance of an object. at
Pharmacy.ComingSoon.Page_Load(Object sender, EventArgs e) Test=Test.

This means to me that either the Session_Start is not firing or the
Session is not being maintained. Any ideas?

I believe it is some kind of configuration issue.

Feb 6 '06 #1
1 2206
jcode,
try adding an item to Session from somewhere OUTSIDE of the Session_Start
handler, say in Page_Load.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jcode" wrote:
I have an ASPNET application that has worked correctly on couple of
servers. I have just deployed it to another server and cannot resolve
an issue.

It appears as if the Session_Start is not firing or session state is
not being maintained.

First lines of Session_Start:

string loc = "LoadSettings";
Session.Add("Session_Start_Loc", loc);

Inside Page_Load of first page to be displayed:

try
{
sessionerr = Session["Session_Start_Loc"].ToString();
lblExc.Text += " Session_Start_Loc=" + sessionerr;
}
catch(Exception ex1){lblExc.Text += " Exception in Session_Start_Loc="
+ex1;}

try
{
Session.Add("Test", "Test");
lblExc.Text += " Test=" + Session["Test"].ToString();
}
catch {lblExc.Text += " Test=Failed to retrieve";}

The result is: Exception in
Session_Start_Loc=System.NullReferenceException: Object reference not
set to an instance of an object. at
Pharmacy.ComingSoon.Page_Load(Object sender, EventArgs e) Test=Test.

This means to me that either the Session_Start is not firing or the
Session is not being maintained. Any ideas?

I believe it is some kind of configuration issue.

Feb 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Chris Allen | last post by:
Hi I'm new to PHP and I'm trying to create a Login Form. Once the user has logged in then he shouldn't have to log in again. The trouble is I'm getting a new session ID between every page and so...
3
by: Trogdor | last post by:
I set up a server on an AMD 650 machine running gentoo linux. I installed Apachie 2, MySQL 4.1 and PHP 4.3.11 I use another computer on my local net (192.168.0.x) to access the server as a...
6
by: Jeff Smythe | last post by:
Why does Session_Start in Global.asax fire for every page opened during a session of an ASP.NET application? Am I wrong to expect that it would fire only when the first page (i.e., any page in...
4
by: M O J O | last post by:
Hi, I have a test application, that is a Web.config, a Global.asax, default.aspx and a final.aspx page. When a user enters my application, I want session_start to always redirect him to the...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
1
by: Bill Manring | last post by:
The startup page for my ASP.NET application is an HTML frames page with two frames. This seems to cause the Session_Start event in the Global.asax file to fire twice. When I change the startup...
0
by: Jason Lehman | last post by:
When testing on my local machine, the session_start fires fine. I try storing a value to my database, creating a timestamped text file, and writing a line of text to a general log file. All of...
1
by: rockdale | last post by:
Hi: I have a web application which runs fine on our production server. But now when I install abother production server, it gets "System.NullReferenceException: Object reference not set to an...
5
by: greg | last post by:
Written in Asp.Net 2.0 The session_start fires on Development server running withing Visual Studio 2005 and also if access web site via localhost on development machine. But if copy to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.