473,835 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session variable data being lost

Our website contains session variables that are used to validate if a user is
logged in etc. We have found that these variables are randomly lost while
navigating the website.

We set up some basic code (as shown below) which used a meta tag to refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file, recreates
the data in the variable and continues. As you can see this script contains
no databases calls etc.

<%response.writ e(session("User name") & "<br>" & Session.Session ID)
if len(session("Us ername"))=0 then
Dim FILENAME as String = Server.MapPath( "Output.txt ")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText (FILENAME)
objStreamWriter .WriteLine(Date Time.Now.ToStri ng())
objStreamWriter .Close()
session("Userna me") = "HelloWorld "
end if %>

The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09

As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the same. I
assume the reason it does stay the same is because that specific data is held
on the client and passed to the server on every communication to the server.

Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have found
there are many reasons why this data can be lost. For example if any .config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also been
tested by us and can confirm this happens.

As our website is hosted on a shared server, we assume that other sites are
or could be having similar issues as us.

Has anyone experienced this particular issue before?

Thanks in advance.

Regards

Sarah Marriott.
Apr 18 '06 #1
4 2876
Tell your ISP to turn off the AV check.

"Sarah Marriott" <Sarah Ma******@discus sions.microsoft .com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
Our website contains session variables that are used to validate if a user
is
logged in etc. We have found that these variables are randomly lost while
navigating the website.

We set up some basic code (as shown below) which used a meta tag to
refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file,
recreates
the data in the variable and continues. As you can see this script
contains
no databases calls etc.

<%response.writ e(session("User name") & "<br>" & Session.Session ID)
if len(session("Us ername"))=0 then
Dim FILENAME as String = Server.MapPath( "Output.txt ")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText (FILENAME)
objStreamWriter .WriteLine(Date Time.Now.ToStri ng())
objStreamWriter .Close()
session("Userna me") = "HelloWorld "
end if %>

The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09

As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the
same. I
assume the reason it does stay the same is because that specific data is
held
on the client and passed to the server on every communication to the
server.

Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have
found
there are many reasons why this data can be lost. For example if any
.config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also
been
tested by us and can confirm this happens.

As our website is hosted on a shared server, we assume that other sites
are
or could be having similar issues as us.

Has anyone experienced this particular issue before?

Thanks in advance.

Regards

Sarah Marriott.

Apr 18 '06 #2
Hi Jeff,

Sorry for the late reply - you know how ISPs are at getting back to you :)

We asked the questions, and they stated that AV doesn't actually run on
their webservers.

Any other ideas?

Regards

Sarah

"Jeff Dillon" wrote:
Tell your ISP to turn off the AV check.

"Sarah Marriott" <Sarah Ma******@discus sions.microsoft .com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
Our website contains session variables that are used to validate if a user
is
logged in etc. We have found that these variables are randomly lost while
navigating the website.

We set up some basic code (as shown below) which used a meta tag to
refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file,
recreates
the data in the variable and continues. As you can see this script
contains
no databases calls etc.

<%response.writ e(session("User name") & "<br>" & Session.Session ID)
if len(session("Us ername"))=0 then
Dim FILENAME as String = Server.MapPath( "Output.txt ")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText (FILENAME)
objStreamWriter .WriteLine(Date Time.Now.ToStri ng())
objStreamWriter .Close()
session("Userna me") = "HelloWorld "
end if %>

The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09

As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the
same. I
assume the reason it does stay the same is because that specific data is
held
on the client and passed to the server on every communication to the
server.

Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have
found
there are many reasons why this data can be lost. For example if any
.config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also
been
tested by us and can confirm this happens.

As our website is hosted on a shared server, we assume that other sites
are
or could be having similar issues as us.

Has anyone experienced this particular issue before?

Thanks in advance.

Regards

Sarah Marriott.


Apr 21 '06 #3
I've been having strange problems for the past month, since going live
with a new site. (http://www.paintworldinc.com) At first I thought
these were user errors. As traffic has been steadily increasing, so
have these errors. They are EXACTLY as you describe. Sometimes, a user
will get as far as the checkout page, populate the form, then hit the
submit - that's when the system will throw an exception. I have code in
place to catch these errors, and write the exception.messa ge text to
the database. They have been due to trying to insert a null into a
required database field - this is data that was held in a session
variable.

I was going to use persistent state - but my host provider does not yet
support it, although they might be turning this on as I write.

Aside from that, I may just implement my own custom session variable
store - using SQL Server as my storage.

If you solve this, please post back as to your own solution.

Regards,

-DG

Sarah Marriott wrote:
Our website contains session variables that are used to validate if a user is
logged in etc. We have found that these variables are randomly lost while
navigating the website.

We set up some basic code (as shown below) which used a meta tag to refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file, recreates
the data in the variable and continues. As you can see this script contains
no databases calls etc.

<%response.writ e(session("User name") & "<br>" & Session.Session ID)
if len(session("Us ername"))=0 then
Dim FILENAME as String = Server.MapPath( "Output.txt ")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText (FILENAME)
objStreamWriter .WriteLine(Date Time.Now.ToStri ng())
objStreamWriter .Close()
session("Userna me") = "HelloWorld "
end if %>

The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09

As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the same. I
assume the reason it does stay the same is because that specific data is held
on the client and passed to the server on every communication to the server.

Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have found
there are many reasons why this data can be lost. For example if any .config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also been
tested by us and can confirm this happens.

As our website is hosted on a shared server, we assume that other sites are
or could be having similar issues as us.

Has anyone experienced this particular issue before?

Thanks in advance.

Regards

Sarah Marriott.


May 14 '06 #4
Hi,

Our ISP finally got back to us saying that this problem is due to our site
being held on a Server Farm. There is nothing they will do to resolve this
issue. So we have had to handle it by storing a flag in the db which the code
checks if there is no session data available. If the flag has been set then
it re-establishes the session data. This is tedious and does result in more
calls to the db, but the site is more stable.

I'm guessing that you'll have to implement something similar or use the db
like you say.

This is rather annoying and I'm surprised more people are not complaining
about it. Maybe many people do not realise this is happening - scary!

Hope this helps.

Best regards,

Sarah

"df********@gma il.com" wrote:
I've been having strange problems for the past month, since going live
with a new site. (http://www.paintworldinc.com) At first I thought
these were user errors. As traffic has been steadily increasing, so
have these errors. They are EXACTLY as you describe. Sometimes, a user
will get as far as the checkout page, populate the form, then hit the
submit - that's when the system will throw an exception. I have code in
place to catch these errors, and write the exception.messa ge text to
the database. They have been due to trying to insert a null into a
required database field - this is data that was held in a session
variable.

I was going to use persistent state - but my host provider does not yet
support it, although they might be turning this on as I write.

Aside from that, I may just implement my own custom session variable
store - using SQL Server as my storage.

If you solve this, please post back as to your own solution.

Regards,

-DG

Sarah Marriott wrote:
Our website contains session variables that are used to validate if a user is
logged in etc. We have found that these variables are randomly lost while
navigating the website.

We set up some basic code (as shown below) which used a meta tag to refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file, recreates
the data in the variable and continues. As you can see this script contains
no databases calls etc.

<%response.writ e(session("User name") & "<br>" & Session.Session ID)
if len(session("Us ername"))=0 then
Dim FILENAME as String = Server.MapPath( "Output.txt ")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText (FILENAME)
objStreamWriter .WriteLine(Date Time.Now.ToStri ng())
objStreamWriter .Close()
session("Userna me") = "HelloWorld "
end if %>

The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09

As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the same. I
assume the reason it does stay the same is because that specific data is held
on the client and passed to the server on every communication to the server.

Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have found
there are many reasons why this data can be lost. For example if any .config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also been
tested by us and can confirm this happens.

As our website is hosted on a shared server, we assume that other sites are
or could be having similar issues as us.

Has anyone experienced this particular issue before?

Thanks in advance.

Regards

Sarah Marriott.


May 21 '06 #5

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

Similar topics

9
2995
by: Xizor | last post by:
Let's say I run a server. I have two people using the server. Bill and Joe. Bill is at address.com/bill and Joe is at address.com/joe. Let's say Joe and Bill are both using PHP with sessions on their web pages. Let's say they both create the session variable $_SESSION. Each uses yo for a different purpose. Now we have a user accessing address.com. He goes to Bill's site and his session his started with the $_SESSION created.
3
2860
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 client browser when the app is accessed the session variable returns null inspite of a value being already set. I have checked the IIS enable session state settings. When i use the server machine as client and access the app as localhost then...
7
7233
by: Billy Jacobs | last post by:
I am having a problem with my session variable being set to Null for no apparent reason. I am declaring it like the following when the user logs in. dim objUserInfo as new clsUserInfo 'Set some properties objUserInfo.UserName = txtUserName.text.trim objUserInfo...
6
1586
by: -D- | last post by:
I'm trying to accomplish the following. I'm trying to get the values for the table rows that are dynamically created to persist through a redirect. Referring URL: http://www.dwayneepps.com/abr_site/fundingrequest.asp If you click on the "New Transaction" button it will generate a new row for the user to input information. I call a javascript function when the user clicks the "New Transaction" button that redirects to another page that...
1
2342
by: ramsankar | last post by:
Hi All, When viewing my php page using IE6.0, I am losing my session data. In the first page I am setting a value to the session variable. In the next page "SOME TIME" the value of the session variable is not same as what I set in the previous page. My session data is lost. This is happening very frequently in IE6.0 sp2 and very less frequently in IE6.0 sp1.
4
4964
by: DeeAnn | last post by:
We've encountered a "flaky" situation with a Session variable holding a data set on load balanced servers; server session with cookies is set up. Background: Session variable holds a dataset. Dataset is retrieved and updated periodically. Eventually the dataset is sent to a web service for processing.
3
2617
by: William | last post by:
Hi I have an ASP.NET application that connects to an Access database. Everything works fine except for the Session object. Data in the session object is lost after I've made a call to the database. To test, I've created two test aspx pages. Test1.aspx contains two buttons. The first button sets values in the session object and then navigates to Test2.aspx. Test2.aspx only displays the values in the session object. The second button...
9
2551
by: Adrian Parker | last post by:
We have a website that works everywhere but on a few PCs on this one site.. Asp.Net 1.1 Server = Windows 2003 Client = XP In the web.config we use - cookieless="false" in the browser settings they have "Always allow session cookies" set to true When the browser connects to the website the first page sets a session variable called "user_ref" to something and then calls another page. If on
5
4115
by: Sam | last post by:
Hi All, I have a very weird issue with my session variable and I'm hoping that someone can help me out. The issue is my session variable dissappears after a request is redirected to a new page. What I have in this new page is streamwriter which writes user's data to a log file. Now if I comment out the line that calls the write method of the streamwriter, the session variable is fine. Thanks in advance for any helps
0
9802
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10807
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10517
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10559
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10230
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7765
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3086
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.