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

Session Scope Variables


Hi Experts,

I want to create an object within the session scope
(one that will be unique to everyone who logs into the system),
yet persist throughout the login session.

Would the "document" object suffice?
... or do I need to go up to the next level in scope?
AK
Jul 23 '05 #1
7 5958
Ivo
"Anna K." wrote
I want to create an object within the session scope
(one that will be unique to everyone who logs into the system),
yet persist throughout the login session.

Would the "document" object suffice?
... or do I need to go up to the next level in scope?


I 'm afraid that wouldn't help much. Javascript has no notion of sessions.
It only knows the current page, it is born onload and dies onunload. You
need some serverside technology like ASP or PHP to create sessions existing
over multiple pages.
HTH
--
Ivo
Jul 23 '05 #2
On Tue, 16 Nov 2004 03:20:39 +0100, "Ivo" <no@thank.you> wrote:
"Anna K." wrote
I want to create an object within the session scope
(one that will be unique to everyone who logs into the system),
yet persist throughout the login session.

Would the "document" object suffice?
... or do I need to go up to the next level in scope?


I 'm afraid that wouldn't help much. Javascript has no notion of sessions.
It only knows the current page, it is born onload and dies onunload. You
need some serverside technology like ASP or PHP to create sessions existing
over multiple pages.
HTH


Yes - this DOES help.

Thank you very much.

One question: What does the <server></server> tag pair do?
AK
Jul 23 '05 #3
Ivo wrote on 16 nov 2004 in comp.lang.javascript:
I 'm afraid that wouldn't help much. Javascript has no notion of
sessions. It only knows the current page, it is born onload and dies
onunload. You need some serverside technology like ASP or PHP to
create sessions existing over multiple pages.


Incorrect,
inasmuch as "javascript" would mean "clientsided script".

ASP understands serversided(!) J(ava)script
and can use javascript accessable session variables and databases.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 23 '05 #4
"Anna K." wrote:
On Tue, 16 Nov 2004 03:20:39 +0100, "Ivo" <no@thank.you> wrote:
"Anna K." wrote
I want to create an object within the session scope
(one that will be unique to everyone who logs into the system),
yet persist throughout the login session.

Would the "document" object suffice?
... or do I need to go up to the next level in scope?


I 'm afraid that wouldn't help much. Javascript has no notion of sessions.
It only knows the current page, it is born onload and dies onunload. You
need some serverside technology like ASP or PHP to create sessions existing
over multiple pages.
HTH


Yes - this DOES help.

Thank you very much.

One question: What does the <server></server> tag pair do?


On Netscape (Sun ONE) Enterprise servers, the <server></server> tag pair
delimits server-side JavaScript code (or at least used to, I am not familiar
with their latest server offerings). Other application servers may use them as
well. Personally I'd recommend using a more robust server-side technology (such
as JSP or PHP), even when server-side JavaScript is provided.

<url: http://docs.sun.com/source/816-5930-10/intro.htm#13144 />

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #5
On Tue, 16 Nov 2004 14:39:00 GMT, Grant Wagner <gw*****@agricoreunited.com> wrote:
"Anna K." wrote:
On Tue, 16 Nov 2004 03:20:39 +0100, "Ivo" <no@thank.you> wrote:
>"Anna K." wrote
>> I want to create an object within the session scope
>> (one that will be unique to everyone who logs into the system),
>> yet persist throughout the login session.
>>
>> Would the "document" object suffice?
>> ... or do I need to go up to the next level in scope?
>
>I 'm afraid that wouldn't help much. Javascript has no notion of sessions.
>It only knows the current page, it is born onload and dies onunload. You
>need some serverside technology like ASP or PHP to create sessions existing
>over multiple pages.
>HTH
Yes - this DOES help.

Thank you very much.

One question: What does the <server></server> tag pair do?


On Netscape (Sun ONE) Enterprise servers, the <server></server> tag pair
delimits server-side JavaScript code (or at least used to, I am not familiar
with their latest server offerings). Other application servers may use them as
well. Personally I'd recommend using a more robust server-side technology (such
as JSP or PHP), even when server-side JavaScript is provided.


This looks like good advice - thanks.

<url: http://docs.sun.com/source/816-5930-10/intro.htm#13144 />


I have this site bookmarked - thanks again.

AK
Jul 23 '05 #6
On 16 Nov 2004 10:51:17 GMT, "Evertjan." <ex**************@interxnl.net> wrote:
Ivo wrote on 16 nov 2004 in comp.lang.javascript:
I 'm afraid that wouldn't help much. Javascript has no notion of
sessions. It only knows the current page, it is born onload and dies
onunload. You need some serverside technology like ASP or PHP to
create sessions existing over multiple pages.


Incorrect,
inasmuch as "javascript" would mean "clientsided script".

ASP understands serversided(!) J(ava)script
and can use javascript accessable session variables and databases.


So I would use the <server> tags with ASP (as Grant Wagner pointed out).

AK
Jul 23 '05 #7
Anna K. wrote on 17 nov 2004 in comp.lang.javascript:
So I would use the <server> tags with ASP (as Grant Wagner pointed
out).


No, not with ASP [on a Server running Windows]

Use:

<script language=jscript runat=server>
for (var i=0;i<10;i++) response.write(i+'<br>');
session("test") = ++i
</script>

Or:

<%@ Language=JScript %>

<%
for (var i=0;i<10;i++) response.write(i+'<br>');
session("test") = ++i
%>

Warning:
mixing(!) jscript and vbscript in ASP has it's peculiar priorities

For jscript and vbscript ASP questions I suggest the NG:
microsoft.public.inetserver.asp.general

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 23 '05 #8

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

Similar topics

7
by: Nicole | last post by:
Hi I'm trying to use a function to set a session variable. I have three files: The first file has: <?php session_start(); // This connects to the existing session ?> <html> <head>
4
by: Dean | last post by:
I finally got class session variables to work by putting the following in global.asax in the session_start: dim myDBComp as DBComp = new DBComp........ session("myDBComp") = myDBComp In each...
4
by: John Smith Jr. | last post by:
Could someone enlighten me what the difference between viewstate[" and session[" variables in terms of use, performance, and rule of thumb, from what I understand viewstate has overhead to it, and...
2
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...
8
by: Dave Wurtz | last post by:
All, I'm new to ASP development and I have a basic design question: Is it ok to store business objects to session variables or is there a better way to keep object information? For example,...
2
by: Don | last post by:
I'm asking this for a friend of mine, so forgive me if I'm getting some of the terminology wrong (I don't have any experience with ASP.NET). I've got an ASP application that has some classes that...
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...
9
by: Randy | last post by:
Hello, I'm having a strange problem. I've got a .NET web app which uses Session variables. Sometime, not all the time, they get cross threaded...that is...one user will have another user's Session...
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...
3
by: mikeboston | last post by:
Hi, I am attempting to use php session variables on a server which is running Red Hat Linux, but the variables don't seem to be getting passed between pages. I have tried the same exact test...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.