473,722 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session Confusion

BackGround:
- We are new to ASP
- We thought we would experiment with using the session object (in proc) to store a small amount of data.
- We get different results when cookieless is set to "true" veses "false".
- Our simple test app involved updating a counter that was stored as an item in the Session Object. We allow resetting the counter to zero, and adding or subtracting one from the counter.
- We were trying to determine when a "NEW Session" is created -- so we kept in our App adding and resetting and subtracting. After each we displayed the values and everything worked fine. When the user entered a URL for a different site (Goggle.com) and then entered the URL for our page -- initially we see that the counter was reset to zero through our logic in the "Page_Load" routine for a new session.
- When using Session option of Cookieless = 'false', when we do an add it picks up the previous Counter Value that was used before we went to the other Web site (Goggle.com). This is confusing because we use the Session Counter field to display the Counter when 1st returning to this page and it displays a value of Zero. We also noticed that the Session ID does not change but "Session.IsNewS ession" property is set to True.
- When using Session option of Cookieless = 'true', when we do an add it picks up the new initialized Counter Value (Zero) that was set in "Page_Load" after returning from the Web site (Goggle.com). In this case we see a new SessionID and the "Session.IsNewS ession" property is set to True.

If you would like to see this in action where "SessionSta te" cookieless option ="false" you can use the following link.

http://www.hoffmanngroupservices.com...THomePage.aspx

Thanks
Dinkster

Nov 18 '05 #1
2 1860
Please read this to understand what is going on with session and how new
requests affect it.
http://tinyurl.com/2t7gq

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Dinkster" <an*******@disc ussions.microso ft.com> wrote in message
news:4D******** *************** ***********@mic rosoft.com...
BackGround:
- We are new to ASP
- We thought we would experiment with using the session object (in proc) to store a small amount of data. - We get different results when cookieless is set to "true" veses "false". - Our simple test app involved updating a counter that was stored as an item in the Session Object. We allow resetting the counter to zero, and
adding or subtracting one from the counter. - We were trying to determine when a "NEW Session" is created -- so we kept in our App adding and resetting and subtracting. After each we
displayed the values and everything worked fine. When the user entered a
URL for a different site (Goggle.com) and then entered the URL for our
page -- initially we see that the counter was reset to zero through our
logic in the "Page_Load" routine for a new session. - When using Session option of Cookieless = 'false', when we do an add it picks up the previous Counter Value that was used before we went to the
other Web site (Goggle.com). This is confusing because we use the Session
Counter field to display the Counter when 1st returning to this page and it
displays a value of Zero. We also noticed that the Session ID does not
change but "Session.IsNewS ession" property is set to True. - When using Session option of Cookieless = 'true', when we do an add it picks up the new initialized Counter Value (Zero) that was set in
"Page_Load" after returning from the Web site (Goggle.com). In this case we
see a new SessionID and the "Session.IsNewS ession" property is set to True.
If you would like to see this in action where "SessionSta te" cookieless option ="false" you can use the following link.
http://www.hoffmanngroupservices.com...THomePage.aspx

Thanks
Dinkster

Nov 18 '05 #2
Dinkster,

You need to probably better understand how browsers treat cookies in order
to better understand ASP.NET sessions (cookieless=fal se). Primarily there
are two types of cookies. Those that get saved on the hard drive somewhere
and those that are not. The second variety are called session cookies. These
have nothing to do with ASP/ASP.NET sessions but actually to do with a
browser session. Session cookies are valid/available till a browser session
is active. In other words, till as long as the browser instance is not
closed, the session cookie (once set) is available. Once the browser is
closed, the session cookie is gone (that is, the browser session has ended).

ASP.NET creates these kind of cookies (browser session cookies). As a result
you see the behavior you see. That is, even if you go to another website and
come back, the ASP.NET session is still "alive" (provided the session
timeout has not elapsed). This explanation should clear your confusion.

As regards "new" sessions etc. you might want to use the global.asax file
with various events for when sessions start, end etc. Using these events are
probably a better way to hook into starting and ending of sessions.
--
Shiv R. Kumar
http://www.matlus.com
Nov 18 '05 #3

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

Similar topics

8
1480
by: Lichunlin | last post by:
Dear all, Sorry for cross posting. I have one page, create an object and save it in session scope, and then redirect to another page.In the new page, the object existed in session object, but can not access its property. The code of page one is : <% Class SiteInfo dim SiteID, SiteName end class
5
2672
by: Jon Booth | last post by:
I want to write an apsx page that when loaded does not refresh Session.Timeout. It is going to be running in an iframe and refreshing every couple of minutes. example. User has 15 minutes left until session expires. iframe.aspx loads and session still has 15 minutes left. Is this possible? I was trying to grab session.timeout at the begininning of the page (init)
8
8412
by: karahan celikel | last post by:
I realized that when SqlServer mode is used for session management Session_End event is not fired in global.asax. What can I do if I want to do something when a user's session end? Thanks
3
3325
by: Green | last post by:
Hi, I want to test whether a sesion exist, what can i do? I use Session.toString().length == 0 , but it will prompt the error saying object is not referenced. How can i test Session exist? Thanks in advance!
6
2433
by: Kermit Piper | last post by:
Hello, I thought this should be easy, but... all I want to do is set the value of this state drop-down based on a session var I'm getting back from a redirect (from the processing page): <% tax = session("Tax") city = session("City") state = session("State") %>
17
1583
by: Jan Kucera | last post by:
Hi. How can I join session or read Session variables if I have the SessionID (or anything what I can supply)? Imagine I have a external link from my webpages, which opens an application which is expected to make requests to the server. It starts another session, but I need to use the session from browser. To the link I'm able to send any property the server can give me. Thanks, Jan.
20
2559
by: p175 | last post by:
Hi people, I have a stored procedure that creates many Global temporary session tables. Into each of these tables go the results of various processing using relational division all keyed and based on a common ID from an ID session table. So we can have various session tables with differing results but if they contain records, they are all keyed to the common ID. My problem now however is how do I report the overall findings of the
3
2120
by: Arnost Sobota | last post by:
Dear ASP community, I have a question regarding ASP session variables. My assumption was that a session variable has the same lifetime as the session itself: as a consequence, given that closing the browser doesn't terminate the session, the session variable is kept alive until the session expires. But, surprisingly, I've found this to be true for the session variables
4
2872
by: rgparkins | last post by:
Hello I am running out of time with a problem I have running PHP 5.04 and Apache 2.0 and really need help :(. I have a page that stores a variable in session but each time I reload that page the session seems to be re-created and is an empty array. I have checked the session file and the variable is being stored against the session id, but I dont know why PHP is not picking up the session after I reload.. I have tried the usual suspects...
0
9384
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
9238
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
9157
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
9088
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
8052
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...
0
4502
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
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2602
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
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.