473,395 Members | 1,452 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,395 software developers and data experts.

Session Variables

Hi everyone,

I've been using ASP on a few different projects over the past year, either
using Javascript or VBScript. During that time, I've made use of session
variables, but even then, I've tried to keep those variables to a minimum
(which is not always easy).

I've also read on many ASP resource sites (such as fuzzysoftware.com, etc)
that the use of session variables can be a no-no, while others say that it's
perfectly valid to use them extensively. Some articles on these sites state
that if we use session variables on a site that is spanned across a web
farm, those variables will either get corrupt, lost, or even worse, abducted
by UFO's (kidding).

Since I'm sure a lot of you have had more experience in this area than I
have, I was wondering what the "thought of the day" is, pertaining to the
use of session variables.

Thanks guys,
Brad
Jul 19 '05 #1
2 5163
I avoid them for just about everything. At some point around version 5,
Microsoft tried to give IE the ability to straddle multiple sessions from
within a single Windows user session, and introduced a nightmare that hasn't
resolved itself yet. MS then compounded the problem by taking away from the
user the ability to control whether new windows browse in new sessions.

Look here for a glimpse:
http://aspfaq.com/show.asp?id=2157

I have noticed a sudden increase in lost sessions with IE6 that began a few
months ago, presumably coinciding with the release of some patch. In my
organization, we have documented many machines that behave better or worse
depending on the number of other applications running. Why on earth this
would affect session persistence is beyond me.

Tack on ever-mutating security policies that (a) affect the sharing of
sessions across frames/popups/iframes/new windows, and (b) keep overwriting
preferences every time Windows Update prompts the user to patch the browser
or leave himself vulnerable to an earth-shattering, "new" (MS speak for
"it's been there all along") vulnerability, and it's a wonder that sessions
work at all.

It's a shame, too -- these problems are unique to IE. No other browser gives
session cookies this unique treatment. And even IE behaves properly with
normal cookies (it shares them among all windows). If you design your own
session architecture (generate unique, pseudorandom IDs, send them to the
browser as plain-old cookies, manage session data in a DB, etc.) IE will
work perfectly and in a manner consistent with other browsers. But you can't
use your own cookie to piggyback onto a session, so you can't solve the
problems with session cookies without dropping session variables altogether
(or at least not using them for anything important).

Do I sound bitter? Remediating a bunch of applications written by someone
else will do that to you. Especially when those apps shouldn't be broken,
except for the shifting landscape that is Microsoft Internet Explorer.
"Brad" wrote:

I've been using ASP on a few different projects over the past year, either
using Javascript or VBScript. During that time, I've made use of session
variables, but even then, I've tried to keep those variables to a minimum
(which is not always easy).

I've also read on many ASP resource sites (such as fuzzysoftware.com, etc)
that the use of session variables can be a no-no, while others say that it's perfectly valid to use them extensively. Some articles on these sites state that if we use session variables on a site that is spanned across a web
farm, those variables will either get corrupt, lost, or even worse, abducted by UFO's (kidding).

Since I'm sure a lot of you have had more experience in this area than I
have, I was wondering what the "thought of the day" is, pertaining to the
use of session variables.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #2
Dave,

Thanks for that FAQ, and thanks also for the insight. It seems that
developing this new [database/user intensive] site is going to be a
nightmare. I'm starting to wonder how so many database/user driven sites are
able to work properly.

*sigh* I'm going to have to try to find some mechanism(s) for this so that I
can *create* a sessionId and store it in a hidden form field, along with
other state variables. The FAQ even states that it's possible for the
normally created sessionId to change from page to page. I'm also going to
have to figure out a mechanism for *properly* storing session data in a
database.

:/

Brad
Jul 19 '05 #3

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

Similar topics

9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
5
by: Larry Woods | last post by:
I am losing Session variables, but only those that are set in the page previous to a redirect to a secure page. Anyone seen ANY situation where Session variables just "disappear?" Note that...
6
by: Lina Manjarres | last post by:
Hello, I have a session variable in a login page. Then I go to a form page where I uses the ProfileID and the UserID. Then I go to a result page where I would like to use the UserID as a filter,...
4
by: PJ | last post by:
A particular page seems to be having issues with correctly setting Session variables. I am setting a couple of session variables on the Page_Unload event. While stepping through code, the...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
3
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
6
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...
0
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...
0
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...
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...

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.