473,769 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session variable being cleared--why?

When I visit a specific web page, Request.aspx, for some reason my session
variables are cleared.

I noticed that there is a "EnableSessionS tate" property on the document
object that has three allowed states "True", "false" and "Readonly". I
would assume that by default, if not specified, it is "true".

however, I decided to explicitly set it to true to see if it helps.

i set it to true in the WebForm. no luck.. Then i realized that it used a
Master Page, so I tried to set the same property there to true.

I get the following error message:

Error 3 Error parsing attribute 'enablesessions tate': Type
'System.Web.UI. MasterPage' does not have a public property named
'enablesessions tate'.
C:\MyDocs\vss\S MIT\SMIT.PackTr ack\PackTrack.N ET\BIMasterPage .master 1
Any idea why I can't set this property or how to prevent the Session
Variable from being cleared. I access the web page using a relative Url, do
not explicitly clear the variable, am not using frames, am using only 1 IE
Window.

Can anyone suggest a reason why this is happending?

Also, on a separate thought...Is there any easy way to log response times
(Page Post times) in a centralized way such as the ASAX file. I assume there
is something in TRACING, but I dont know much about. A little direction
point would be helpful.

Thanks!

Jun 6 '07 #1
1 3855
I found the issue:

I did something like this is the top of my aspx code behind class:

Private UserId As String = Session("UserId ")

I change it to

Private UserId As String

and in the form load add:

UserId = Session("UserId ")

Apparently, variables are initialized before the session object is
avaialable for use.
"Chad" <ch************ **@unisys.comwr ote in message
news:f4******** **@trsvr.tr.uni sys.com...
When I visit a specific web page, Request.aspx, for some reason my session
variables are cleared.

I noticed that there is a "EnableSessionS tate" property on the document
object that has three allowed states "True", "false" and "Readonly". I
would assume that by default, if not specified, it is "true".

however, I decided to explicitly set it to true to see if it helps.

i set it to true in the WebForm. no luck.. Then i realized that it used a
Master Page, so I tried to set the same property there to true.

I get the following error message:

Error 3 Error parsing attribute 'enablesessions tate': Type
'System.Web.UI. MasterPage' does not have a public property named
'enablesessions tate'.
C:\MyDocs\vss\S MIT\SMIT.PackTr ack\PackTrack.N ET\BIMasterPage .master 1
Any idea why I can't set this property or how to prevent the Session
Variable from being cleared. I access the web page using a relative Url,
do not explicitly clear the variable, am not using frames, am using only 1
IE Window.

Can anyone suggest a reason why this is happending?

Also, on a separate thought...Is there any easy way to log response times
(Page Post times) in a centralized way such as the ASAX file. I assume
there is something in TRACING, but I dont know much about. A little
direction point would be helpful.

Thanks!

Jun 8 '07 #2

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

Similar topics

11
3351
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option Explicit and Response.Expires=-1,
2
13557
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <% Session("var1") = "Hello" %> And then when I click on a button it refers to the include file, which I believe is all client-side code as there are no server <% %> tags.
4
11744
by: John Kraft | last post by:
Hi all, My question is more of a phylisophical one here, but I am wondering what the difference is (effectively and performance wise) between using a shared variable/static variable and using a session variable. I have two different applications right now that effectively perform the same action at one point. In the one application I created a shared variable:
2
6163
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on which is loosely based on the e-commerce example in the quickstarts tutorial. In the cart display I have provided functionality so that when a user clicks on a product name a popup is opened with the full product details displayed.
2
1498
by: Todd | last post by:
Here's one that has been stumping people: I'm writing in ASPX with VB.NET On the login page I set the entered usename text to a session variable. ************************************************************************ Private Sub lbtnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbtnSubmit.Click Dim bolLogin As Boolean
1
3540
by: Vidyadhar Joshi | last post by:
I have the following scenario in a true load balanced environment (without sticky sessions): There are 2 ASPX pages. I want to pass an object from the first page to the second page. On the btnContinue_Click event of Page1.aspx, I create the object and store it in a session variable. The next statement would be Response.Redirect("Page2.aspx"). The code appears like this: private void btnContinue_Click(object sender, EventArgs e) {...
4
3446
by: Don Miller | last post by:
I am using a Session variable to hold a class object between ASP.NET pages (in VB). In my constructor I check to see if the Session variable exists, and if it doesn't, I create one and populate it with "Me". But if the Session variable already exists, I would like the new object be populated with everything from the object stored in the Session variable. Ideally, I'd like to retrieve the object from the Session variable and assign it to...
17
5093
by: Control Freq | last post by:
Hi, Not sure if this is the right NG for this, but, is there a convention for the variable names of a Session variable? I am using .NET 2.0 in C#. I am new to all this .NET stuff, So, any guidance appreciated. Regards
8
4200
by: YYZ | last post by:
I'm using asp, not asp.net. I've got some open ended questions that I was really hoping someone in here could answer, or direct me to some resources that will help me answer them on my own. First, the session object. When a new user comes to my site, asp creates a session object, and a session id on that object. That session id is sent back to the client and stored as a cookie(?) that can be used to identify a single user across...
5
2207
by: Twayne | last post by:
Hi, If ever a newbie wants to know how much he has to learn yet, he only has to look here<g>!! ANYway: PHP 5.2.5; XP Pro SP2+, local Apache Server My actual question is: How do I get a POST variable into a session variable so I can use it in any other page I want to use it in? Apparently posted variables are only available in the Form page in
0
9589
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
9863
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...
0
8870
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
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
5298
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...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.