473,407 Members | 2,306 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,407 software developers and data experts.

Session State not maintained asp.net 2.0

I must be doing something fundamentally wrong here. This is what I have in
web.config:

<sessionState cookieName="SOMENAME" mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data
source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="15" />
<globalization requestEncoding="ISO-8859-1"
responseEncoding="ISO-8859-1" />
<pages theme="DefaultTheme" enableSessionState="true"
enableViewState="true" enableViewStateMac="true" validateRequest="true" />

I also set the EnableSessionState on the pages explicitly. In one of the
pages I have this code:

protected void Page_Load(object sender, EventArgs e)
{
if (Session["AAAAA"] == null)
{
Session["AAAAA"] = 0;
}
else
{
Session["AAAAA"] = (int)Session["AAAAA"] + 1;
}
}

If I keep refreshing this page, the Session ID is always different and the
Session.IsNewSession is always true. Even though I can see that the value of
0 is set, on every request the session is regenerated... Why would that
happen?

Thank you,

Iulian
--
Regards,

Iulian
Mar 27 '06 #1
2 3004
Well I guess you need to add the GLOBAL.ASAX file in the root directory
of your website.
This is not automatocally added noe in VS.Net 2005 and so you need to
add this manually.

Add New Item --> Global.asax

You don't need to wirte any code. But I hope this should help you out.

Vivek N
MCAD

Mar 27 '06 #2
Ok, I solved it, apparently this was causing the problem:

<sessionState [...] />

Once I removed it from web.config it started to work. This was a
reminescence of the asp 1.1 application and I assume it conflicts with 2.0...

--
Regards,

Iulian
"Iulian" wrote:
I must be doing something fundamentally wrong here. This is what I have in
web.config:

<sessionState cookieName="SOMENAME" mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data
source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="15" />
<globalization requestEncoding="ISO-8859-1"
responseEncoding="ISO-8859-1" />
<pages theme="DefaultTheme" enableSessionState="true"
enableViewState="true" enableViewStateMac="true" validateRequest="true" />

I also set the EnableSessionState on the pages explicitly. In one of the
pages I have this code:

protected void Page_Load(object sender, EventArgs e)
{
if (Session["AAAAA"] == null)
{
Session["AAAAA"] = 0;
}
else
{
Session["AAAAA"] = (int)Session["AAAAA"] + 1;
}
}

If I keep refreshing this page, the Session ID is always different and the
Session.IsNewSession is always true. Even though I can see that the value of
0 is set, on every request the session is regenerated... Why would that
happen?

Thank you,

Iulian
--
Regards,

Iulian

Mar 28 '06 #3

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

Similar topics

1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
3
by: Microsoft | last post by:
I am using Session variables in my ASP application. I have tested the application on a Win2k professional and it works fine. When the same web app is installed on a win2k advanced server from the...
7
by: someone | last post by:
Let's say I have a Session timeout of 20 minutes. If the browser periodically request a graphic file, will that keep its Session alive? What keeps the Session alive? Is it the Session cookie that...
1
by: Jonk Eidersteldvr | last post by:
Hi, I am using a web application -asp, ado, C#, using CodeBehind files etc.. I am using "InProc" session state and find that session variables are loosing their values between one web form and...
6
by: Ilia | last post by:
Hi folks, I have some problems with ASP.NET Session State. The following simple program runs well if the Session State set as "InProc". If I switch to "SQLServer", the changes, made by the...
4
by: John Q. Smith | last post by:
I'm trying to find out some of the details behind OOP state management with SQL Server. For instance - how long does the session object live on any server? Is it created and destoyed with each...
9
by: cashdeskmac | last post by:
I have put a string into Session and tried to retrieve it on the next page I visit but the Session appears empty. I have exactly the same spelling for both adding and retrieving the value: ...
11
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a web application vs2005 and it looks like a condition is causing session veriables to be lost. This does not seem to be happening too often. The web application allows uploading and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.