Hi all,
Is there any limit to the number of session variables a site can have? And
is that affected by global.asa at all?
The reason why i ask is that i have a relatively simple site that relies on
about 40 sesion variables and a mixture of vbs and js files. One of the
session variables is an id number that gets incremented to point to the next
piece of data to be displayed. This variable is initialised on the first
page of the site and then incremented. However, if you quit the site, and
then access the site again, this variable is not reset to its initial value.
Any ideas?
Martin 14 2892
Martin Walke wrote: Hi all,
Is there any limit to the number of session variables a site can have? And is that affected by global.asa at all?
The reason why i ask is that i have a relatively simple site that relies on about 40 sesion variables and a mixture of vbs and js files. One of the session variables is an id number that gets incremented to point to the next piece of data to be displayed. This variable is initialised on the first page of the site and then incremented. However, if you quit the site, and then access the site again, this variable is not reset to its initial value.
Unless you close all browser windows that were open when the session was
begun, you will not get a new session.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
> Unless you close all browser windows that were open when the session was begun, you will not get a new session.
Thanks Bob but yep - knew that. But in this case, I'm setting the variable
to its initial value but that doesn't seem to be happening. So i'm just
wondering what would stop a session variable from being updated to a new
value.
Martin
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uP**************@TK2MSFTNGP02.phx.gbl... Martin Walke wrote: Hi all,
Is there any limit to the number of session variables a site can have? And is that affected by global.asa at all?
The reason why i ask is that i have a relatively simple site that relies on about 40 sesion variables and a mixture of vbs and js files. One of the session variables is an id number that gets incremented to point to the next piece of data to be displayed. This variable is initialised on the first page of the site and then incremented. However, if you quit the site, and then access the site again, this variable is not reset to its initial value. Unless you close all browser windows that were open when the session was begun, you will not get a new session. -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup.
Martin Walke wrote: Unless you close all browser windows that were open when the session was begun, you will not get a new session. Thanks Bob but yep - knew that. But in this case, I'm setting the variable to its initial value but that doesn't seem to be happening.
When/where are you doing that?
So i'm just wondering what would stop a session variable from being updated to a new value.
Nothing that I know of.
Could you explain the process in a little more detail?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Martin Walke wrote: Unless you close all browser windows that were open when the session was begun, you will not get a new session.
Thanks Bob but yep - knew that. But in this case, I'm setting the variable to its initial value but that doesn't seem to be happening. So i'm just wondering what would stop a session variable from being updated to a new value.
I suspect that what is happening is that you are not getting a new
session when you expect to be getting one. The best way to confirm this
is to display the session id, which should change when a new session is
started.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] wrote: Unless you close all browser windows that were open when the session was begun, you will not get a new session.
Well, that's not entirely true. You ought to get a new one after
Session.Abandon().
--
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.
Thanks for the responses guys.
OK.. maybe I'm confused about session variables. My site opens in a new
window from a link. I have a line
<%
....
session("qid") = 0
....
%>
that is on the first page of my site. This session variable is used to
determine what information is to be shown on the next page. The next page
increments this session variable and after user interaction, the page is
shown again (but with different info) based on the value of 'qid'.
<%
....
session("qid") = session("qid") + 1
....
%>
If the user then quits this site (but doesn't close all browser windows) and
then returns to the site, the session variable is not reset to 0 on the
first page.
The real rub here is that it works on 3 other servers, plus PWS, but not on
the client's live server. What gives?
Martin
"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:u9**************@TK2MSFTNGP03.phx.gbl... Bob Barrows [MVP] wrote: Unless you close all browser windows that were open when the session was begun, you will not get a new session.
Well, that's not entirely true. You ought to get a new one after Session.Abandon(). -- 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.
Martin Walke wrote on 02 jun 2006 in
microsoft.public.inetserver.asp.general: OK.. maybe I'm confused about session variables. My site opens in a new window from a link. I have a line
<% ... session("qid") = 0 ... %> that is on the first page of my site. This session variable is used to determine what information is to be shown on the next page. The next page increments this session variable and after user interaction, the page is shown again (but with different info) based on the value of 'qid'.
<% ... session("qid") = session("qid") + 1 ... %>
If the user then quits this site (but doesn't close all browser windows) and then returns to the site, the session variable is not reset to 0 on the first page.
The real rub here is that it works on 3 other servers, plus PWS, but not on the client's live server. What gives?
It should "work". Try making a minimalistic test set of files and try it
again. Also try it with other browsers and from othe url's.
==========================
Why not use a "work-around" and do the initializing on the counting page?
This is a must anyway if that page is accessable after timeout or from an
external link or bookmark anyway:
<%
....
if session("qid") = "" then session("qid") = 0
session("qid") = session("qid") + 1
....
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Ermmmm.... this might be a silly question, but have you checked to see
if Enable Session State has been checked in the Application
configuration on your client's server?
--
Mike Brind
Martin Walke wrote: Thanks for the responses guys.
OK.. maybe I'm confused about session variables. My site opens in a new window from a link. I have a line
<% ... session("qid") = 0 ... %> that is on the first page of my site. This session variable is used to determine what information is to be shown on the next page. The next page increments this session variable and after user interaction, the page is shown again (but with different info) based on the value of 'qid'.
<% ... session("qid") = session("qid") + 1 ... %>
If the user then quits this site (but doesn't close all browser windows) and then returns to the site, the session variable is not reset to 0 on the first page.
The real rub here is that it works on 3 other servers, plus PWS, but not on the client's live server. What gives?
Martin
"Dave Anderson" <GT**********@spammotel.com> wrote in message news:u9**************@TK2MSFTNGP03.phx.gbl... Bob Barrows [MVP] wrote: Unless you close all browser windows that were open when the session was begun, you will not get a new session.
Well, that's not entirely true. You ought to get a new one after Session.Abandon(). -- 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.
Thanks Mike. No I haven't but only as they use Session variables for various
security checks etc and have therefore assumed (cough) that that side would
be OK. I'll double check though.
It may be that this is not really an ASP problem but an IIS problem and is
being visualised as a session variable issue.
Martin
"Mike Brind" <pa*******@hotmail.com> wrote in message
news:11*********************@h76g2000cwa.googlegro ups.com... Ermmmm.... this might be a silly question, but have you checked to see if Enable Session State has been checked in the Application configuration on your client's server?
-- Mike Brind
Martin Walke wrote: Thanks for the responses guys.
OK.. maybe I'm confused about session variables. My site opens in a new window from a link. I have a line
<% ... session("qid") = 0 ... %> that is on the first page of my site. This session variable is used to determine what information is to be shown on the next page. The next page increments this session variable and after user interaction, the page is shown again (but with different info) based on the value of 'qid'.
<% ... session("qid") = session("qid") + 1 ... %>
If the user then quits this site (but doesn't close all browser windows) and then returns to the site, the session variable is not reset to 0 on the first page.
The real rub here is that it works on 3 other servers, plus PWS, but not on the client's live server. What gives?
Martin
"Dave Anderson" <GT**********@spammotel.com> wrote in message news:u9**************@TK2MSFTNGP03.phx.gbl... > Bob Barrows [MVP] wrote: >> Unless you close all browser windows that were open when >> the session was begun, you will not get a new session. > > Well, that's not entirely true. You ought to get a new one after > Session.Abandon(). > > > > -- > 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. >
> Why not use a "work-around" and do the initializing on the counting page? This is a must anyway if that page is accessable after timeout or from an external link or bookmark anyway:
Thanks Evertjan. That's certainly something I can do anyway but perhaps the
symtoms are pointing to something else being wrong and it's just manifesting
itself as the inability to set session variables.
Martin
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242... Martin Walke wrote on 02 jun 2006 in microsoft.public.inetserver.asp.general:
OK.. maybe I'm confused about session variables. My site opens in a new window from a link. I have a line
<% ... session("qid") = 0 ... %> that is on the first page of my site. This session variable is used to determine what information is to be shown on the next page. The next page increments this session variable and after user interaction, the page is shown again (but with different info) based on the value of 'qid'.
<% ... session("qid") = session("qid") + 1 ... %>
If the user then quits this site (but doesn't close all browser windows) and then returns to the site, the session variable is not reset to 0 on the first page.
The real rub here is that it works on 3 other servers, plus PWS, but not on the client's live server. What gives?
It should "work". Try making a minimalistic test set of files and try it again. Also try it with other browsers and from othe url's.
==========================
Why not use a "work-around" and do the initializing on the counting page? This is a must anyway if that page is accessable after timeout or from an external link or bookmark anyway:
<% ... if session("qid") = "" then session("qid") = 0 session("qid") = session("qid") + 1 ... %>
-- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
Finally found the problem. I hadn't placed an expires=-1 on the pages.
Didn't think it was necessary. However, the site was being run through a
proxy server which, of course, was caching the page. Mental note to oneself,
if using session variables, use expires=-1 as well!!
Thanks all, for your input.
Martin
"Martin Walke" <martin.walke_no_spam@vega_dot_co_dot_uk> wrote in message
news:em**************@TK2MSFTNGP05.phx.gbl... Thanks Mike. No I haven't but only as they use Session variables for various security checks etc and have therefore assumed (cough) that that side would be OK. I'll double check though.
It may be that this is not really an ASP problem but an IIS problem and is being visualised as a session variable issue.
Martin
"Mike Brind" <pa*******@hotmail.com> wrote in message news:11*********************@h76g2000cwa.googlegro ups.com... Ermmmm.... this might be a silly question, but have you checked to see if Enable Session State has been checked in the Application configuration on your client's server?
-- Mike Brind
Martin Walke wrote: Thanks for the responses guys.
OK.. maybe I'm confused about session variables. My site opens in a new window from a link. I have a line
<% ... session("qid") = 0 ... %> that is on the first page of my site. This session variable is used to determine what information is to be shown on the next page. The next page increments this session variable and after user interaction, the page is shown again (but with different info) based on the value of 'qid'.
<% ... session("qid") = session("qid") + 1 ... %>
If the user then quits this site (but doesn't close all browser windows) and then returns to the site, the session variable is not reset to 0 on the first page.
The real rub here is that it works on 3 other servers, plus PWS, but not on the client's live server. What gives?
Martin
"Dave Anderson" <GT**********@spammotel.com> wrote in message news:u9**************@TK2MSFTNGP03.phx.gbl... > Bob Barrows [MVP] wrote: >> Unless you close all browser windows that were open when >> the session was begun, you will not get a new session. > > Well, that's not entirely true. You ought to get a new one after > Session.Abandon(). > > > > -- > 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. >
Martin Walke wrote on 05 jun 2006 in
microsoft.public.inetserver.asp.general: Finally found the problem. I hadn't placed an expires=-1 on the pages. Didn't think it was necessary. However, the site was being run through a proxy server which, of course, was caching the page.
Why not expires = -100 ?
If the client GMT is 2 minutes off, the effective timeout is +1 minute.
True, gugus?
Mental note to oneself, if using session variables, use expires=-1 as well!!
Only if the session variables are not all session static in their value.
If the sesson variable only shows the login name, it isn't changing
throughout the session once set.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
"Martin Walke" <martin.walke_no_spam@vega_dot_co_dot_uk> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl... Finally found the problem. I hadn't placed an expires=-1 on the pages. Didn't think it was necessary. However, the site was being run through a proxy server which, of course, was caching the page. Mental note to
oneself, if using session variables, use expires=-1 as well!!
You are correct that Expires shouldn't be necessary since ASP doesn't
generate cacheable content.
So either your ASP is generating headers which makes the proxy server think
the content is cacheable or
the proxy server is making 'intelligent' choices about whether to cache what
strictly speaking it shouldn't.
For example if your ASP page generates the exact same content every time for
a given request a proxy server might assume that it can safely cache the
response.
For belts and braces prevention of caching use:-
Response.Expires = -1440 ' 1 day old
Response.CacheControl = "private, no-cache, max-age=0" 'Only works with
HTTP/1.1 compliant proxies
Anthony
Thanks all, for your input.
Martin
"Martin Walke" <martin.walke_no_spam@vega_dot_co_dot_uk> wrote in message news:em**************@TK2MSFTNGP05.phx.gbl... Thanks Mike. No I haven't but only as they use Session variables for various security checks etc and have therefore assumed (cough) that that side would be OK. I'll double check though.
It may be that this is not really an ASP problem but an IIS problem and
is being visualised as a session variable issue.
Martin
"Mike Brind" <pa*******@hotmail.com> wrote in message news:11*********************@h76g2000cwa.googlegro ups.com... Ermmmm.... this might be a silly question, but have you checked to see if Enable Session State has been checked in the Application configuration on your client's server?
-- Mike Brind
Martin Walke wrote: Thanks for the responses guys.
OK.. maybe I'm confused about session variables. My site opens in a
new window from a link. I have a line
<% ... session("qid") = 0 ... %> that is on the first page of my site. This session variable is used to determine what information is to be shown on the next page. The next page increments this session variable and after user interaction, the page
is shown again (but with different info) based on the value of 'qid'.
<% ... session("qid") = session("qid") + 1 ... %>
If the user then quits this site (but doesn't close all browser
windows) and then returns to the site, the session variable is not reset to 0 on
the first page.
The real rub here is that it works on 3 other servers, plus PWS, but
not on the client's live server. What gives?
Martin
"Dave Anderson" <GT**********@spammotel.com> wrote in message news:u9**************@TK2MSFTNGP03.phx.gbl... > Bob Barrows [MVP] wrote: >> Unless you close all browser windows that were open when >> the session was begun, you will not get a new session. > > Well, that's not entirely true. You ought to get a new one after > Session.Abandon(). > > > > -- > 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. >
Thanks Anthony and Evertjan. All your comments make good sense and are
appreciated.
Martin
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:ul**************@TK2MSFTNGP04.phx.gbl... "Martin Walke" <martin.walke_no_spam@vega_dot_co_dot_uk> wrote in message news:%2****************@TK2MSFTNGP05.phx.gbl... Finally found the problem. I hadn't placed an expires=-1 on the pages. Didn't think it was necessary. However, the site was being run through a proxy server which, of course, was caching the page. Mental note to oneself, if using session variables, use expires=-1 as well!!
You are correct that Expires shouldn't be necessary since ASP doesn't generate cacheable content.
So either your ASP is generating headers which makes the proxy server think the content is cacheable or the proxy server is making 'intelligent' choices about whether to cache what strictly speaking it shouldn't.
For example if your ASP page generates the exact same content every time for a given request a proxy server might assume that it can safely cache the response.
For belts and braces prevention of caching use:-
Response.Expires = -1440 ' 1 day old Response.CacheControl = "private, no-cache, max-age=0" 'Only works with HTTP/1.1 compliant proxies
Anthony
Thanks all, for your input.
Martin
"Martin Walke" <martin.walke_no_spam@vega_dot_co_dot_uk> wrote in message news:em**************@TK2MSFTNGP05.phx.gbl... > Thanks Mike. No I haven't but only as they use Session variables for > various security checks etc and have therefore assumed (cough) that > that > side would be OK. I'll double check though. > > It may be that this is not really an ASP problem but an IIS problem and is > being visualised as a session variable issue. > > Martin > > > "Mike Brind" <pa*******@hotmail.com> wrote in message > news:11*********************@h76g2000cwa.googlegro ups.com... >> Ermmmm.... this might be a silly question, but have you checked to see >> if Enable Session State has been checked in the Application >> configuration on your client's server? >> >> -- >> Mike Brind >> >> Martin Walke wrote: >>> Thanks for the responses guys. >>> >>> OK.. maybe I'm confused about session variables. My site opens in a new >>> window from a link. I have a line >>> >>> <% >>> ... >>> session("qid") = 0 >>> ... >>> %> >>> that is on the first page of my site. This session variable is used >>> to >>> determine what information is to be shown on the next page. The next >>> page >>> increments this session variable and after user interaction, the page is >>> shown again (but with different info) based on the value of 'qid'. >>> >>> <% >>> ... >>> session("qid") = session("qid") + 1 >>> ... >>> %> >>> >>> If the user then quits this site (but doesn't close all browser windows) >>> and >>> then returns to the site, the session variable is not reset to 0 on the >>> first page. >>> >>> The real rub here is that it works on 3 other servers, plus PWS, but not >>> on >>> the client's live server. What gives? >>> >>> Martin >>> >>> "Dave Anderson" <GT**********@spammotel.com> wrote in message >>> news:u9**************@TK2MSFTNGP03.phx.gbl... >>> > Bob Barrows [MVP] wrote: >>> >> Unless you close all browser windows that were open when >>> >> the session was begun, you will not get a new session. >>> > >>> > Well, that's not entirely true. You ought to get a new one after >>> > Session.Abandon(). >>> > >>> > >>> > >>> > -- >>> > 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. >>> > >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Al Jones |
last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate
group would you point me toward one that is.
Basically, I seem to be losing session data part way though preparing an
email from (possibly) three seperate forms.
the following code is the end of a routine which stashes data from the first
form
off to session...
|
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, but I can't get the value is stored in it.
How can I do that?
Thanks a lot!
|
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 immediate window will show the
values in Session after the relevant lines that set the variables in the
Page_Unload event. However, on postback, these...
|
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 using Session variables for three years now and i'm
entering a project with my new boss who has never quite come around that
session variables are...
|
by: tshad |
last post by:
I have been using the default session state (InProc) and have found that I
have been loosing my information after a period of time (normally 20
minutes).
Is there anyway to find out how much more time I have on a session?
If I do a refresh, does reset the session clock?
Do you have have to go to another page to reset the session timeout...
| |
by: Alan Wang |
last post by:
Hi there,
Once my application gets complicated and complicated. I found it's really
hard to keep track of Session value I am using in my asp.net application. I
am just wondering if anyone have any experience on how to keep track of
session value. Any help it's appreciated.
Thanks
Alan
|
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 control.
In its inactive state, only a single button appears. If the user clicks on
this button, the control becomes active( the rest of the...
|
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 File-New-Window creates an
instance of IE in the same process with the same SessionID as the parent
window is in big trouble. This fundamentally restricts...
|
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 opens a new IE window with Ctrl-N or
File-New-Window, BOTH WINDOWS SHARE THE SAME SESSION VARIABLES. This cannot
be prevented.
|
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 email link gets created with an
encoded query string. i.e
http://www.yahoo.ca?#$@%@&#%#$@&^@%# which translates into...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |