Connecting Tech Pros Worldwide Forums | Help | Site Map

QUESTION ON SESSION VARIABLES

Karen
Guest
 
Posts: n/a
#1: Jul 19 '05
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!

Ray at
Guest
 
Posts: n/a
#2: Jul 19 '05

re: QUESTION ON SESSION VARIABLES



"Karen" <bambina_carina@yahoo.com> wrote in message
news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=blue]
> Hi there....
> i got a quick one for you guys. i've this session variable that is
> updated by calling a server method (i set this value when the user
> hits a submit button in my form. The server method is called when i
> load all my asp forms.). I'd like to be able to update this session
> variable, without being forced to submit my form or refresh my form
> (something that will call my server method each 2 min lets say,
> without refreshing my page or submit)...is there anyway to do this???[/color]

No. The only "something" that can update the session is the client. In the
simple world, anyway.

Ray at work


Michel Thiffault
Guest
 
Posts: n/a
#3: Jul 19 '05

re: QUESTION ON SESSION VARIABLES


I neevr tried it tu update session variables (I have session variables with
passion) but calling an ASP page with an XMLHTTP call in JavaScript should
work (I never tried though).

"Karen" <bambina_carina@yahoo.com> wrote in message
news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=blue]
> Hi there....
> i got a quick one for you guys. i've this session variable that is
> updated by calling a server method (i set this value when the user
> hits a submit button in my form. The server method is called when i
> load all my asp forms.). I'd like to be able to update this session
> variable, without being forced to submit my form or refresh my form
> (something that will call my server method each 2 min lets say,
> without refreshing my page or submit)...is there anyway to do this???
> Maybe a remote scripting with the setinterval() method?? but i'm
> having trouble using this with XP and IE 6 !!
>
> Your help is with this matter is higly appreciated!![/color]


Michel Thiffault
Guest
 
Posts: n/a
#4: Jul 19 '05

re: QUESTION ON SESSION VARIABLES


Whoa! Typos!

I never tried to update session variables (I hate session variables with
passion) but calling an ASP page from the client using JavaScript and the
XMLHTTP object should work (I never tried it).

That's better, sorry about that!

"Michel Thiffault" <mtifo@h.ot_m.ai_l.com> wrote in message
news:%23l1Opl%23lDHA.3612@TK2MSFTNGP11.phx.gbl...[color=blue]
> I neevr tried it tu update session variables (I have session variables[/color]
with[color=blue]
> passion) but calling an ASP page with an XMLHTTP call in JavaScript should
> work (I never tried though).
>
> "Karen" <bambina_carina@yahoo.com> wrote in message
> news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=green]
> > Hi there....
> > i got a quick one for you guys. i've this session variable that is
> > updated by calling a server method (i set this value when the user
> > hits a submit button in my form. The server method is called when i
> > load all my asp forms.). I'd like to be able to update this session
> > variable, without being forced to submit my form or refresh my form
> > (something that will call my server method each 2 min lets say,
> > without refreshing my page or submit)...is there anyway to do this???
> > Maybe a remote scripting with the setinterval() method?? but i'm
> > having trouble using this with XP and IE 6 !!
> >
> > Your help is with this matter is higly appreciated!![/color]
>
>[/color]


Tim Williams
Guest
 
Posts: n/a
#5: Jul 19 '05

re: QUESTION ON SESSION VARIABLES



on the client using setinterval:

var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
Date()));

have updatesession.asp do the update to the session variable and then
redirect to a 1x1 gif or something.
The querystring part will force the browser to always make the request
instead of using the cache.


Tim.



"Karen" <> wrote in message
news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=blue]
> Hi there....
> i got a quick one for you guys. i've this session variable that is
> updated by calling a server method (i set this value when the user
> hits a submit button in my form. The server method is called when i
> load all my asp forms.). I'd like to be able to update this session
> variable, without being forced to submit my form or refresh my form
> (something that will call my server method each 2 min lets say,
> without refreshing my page or submit)...is there anyway to do this???
> Maybe a remote scripting with the setinterval() method?? but i'm
> having trouble using this with XP and IE 6 !!
>
> Your help is with this matter is higly appreciated!![/color]


Karen
Guest
 
Posts: n/a
#6: Jul 19 '05

re: QUESTION ON SESSION VARIABLES


Sorry Tim i don't see how i can accomplish this using with your
example....remember my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <saxifrax@pacbellremovethis.net> wrote in message news:<eSX2xTAmDHA.3256@tk2msftngp13.phx.gbl>...[color=blue]
> on the client using setinterval:
>
> var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
> Date()));
>
> have updatesession.asp do the update to the session variable and then
> redirect to a 1x1 gif or something.
> The querystring part will force the browser to always make the request
> instead of using the cache.
>
>
> Tim.
>
>
>
> "Karen" <> wrote in message
> news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=green]
> > Hi there....
> > i got a quick one for you guys. i've this session variable that is
> > updated by calling a server method (i set this value when the user
> > hits a submit button in my form. The server method is called when i
> > load all my asp forms.). I'd like to be able to update this session
> > variable, without being forced to submit my form or refresh my form
> > (something that will call my server method each 2 min lets say,
> > without refreshing my page or submit)...is there anyway to do this???
> > Maybe a remote scripting with the setinterval() method?? but i'm
> > having trouble using this with XP and IE 6 !!
> >
> > Your help is with this matter is higly appreciated!![/color][/color]
Karen
Guest
 
Posts: n/a
#7: Jul 19 '05

re: QUESTION ON SESSION VARIABLES


yeah that's better ...kidding...well thanks for your reply...i kinda
know what i should do but don't relay know how i can accomplish
it??...anyway...hoep someone will help me with it!!
"Michel Thiffault" <mtifo@h.ot_m.ai_l.com> wrote in message news:<ezRnFs#lDHA.1728@TK2MSFTNGP11.phx.gbl>...[color=blue]
> Whoa! Typos!
>
> I never tried to update session variables (I hate session variables with
> passion) but calling an ASP page from the client using JavaScript and the
> XMLHTTP object should work (I never tried it).
>
> That's better, sorry about that!
>
> "Michel Thiffault" <mtifo@h.ot_m.ai_l.com> wrote in message
> news:%23l1Opl%23lDHA.3612@TK2MSFTNGP11.phx.gbl...[color=green]
> > I neevr tried it tu update session variables (I have session variables[/color]
> with[color=green]
> > passion) but calling an ASP page with an XMLHTTP call in JavaScript should
> > work (I never tried though).
> >
> > "Karen" <bambina_carina@yahoo.com> wrote in message
> > news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=darkred]
> > > Hi there....
> > > i got a quick one for you guys. i've this session variable that is
> > > updated by calling a server method (i set this value when the user
> > > hits a submit button in my form. The server method is called when i
> > > load all my asp forms.). I'd like to be able to update this session
> > > variable, without being forced to submit my form or refresh my form
> > > (something that will call my server method each 2 min lets say,
> > > without refreshing my page or submit)...is there anyway to do this???
> > > Maybe a remote scripting with the setinterval() method?? but i'm
> > > having trouble using this with XP and IE 6 !!
> > >
> > > Your help is with this matter is higly appreciated!![/color]
> >
> >[/color][/color]
Tim Williams
Guest
 
Posts: n/a
#8: Jul 19 '05

re: QUESTION ON SESSION VARIABLES



Karen,

If you want to run code on the server from the client, you must make a
request. One way to do this is to submit a form - which you *don't* want to
do - an another is to make a reqest by creating an image and setting its src
attribute to an asp page. This asp page has access to the user's session,
so it can update the session variable before returning the image to the
client.

################### client
<HTML>
<HEAD>
<TITLE> Session Update </TITLE>

<script>
var imgURL="http://myserver/updatesession.asp";
var iCount=0;
var tOut;

function doUpdate(){
iCount++;
var img=new Image();
img.src=imgURL+"?blah="+escape(new Date())
img=null;
document.getElementById("dMsg").innerHTML="Updated : "+iCount;
tOut=window.setTimeout("doUpdate()",2000);
}
</script>
</HEAD>

<BODY onload="doUpdate();">
<div id='dMsg'></div>
</BODY>
</HTML>

################ server (updatesession.asp)

<%

session("your_name")=session("your_name")+1
response.redirect "tiny.gif"

%>

OK?

Tim

"Karen" <bambina_carina@yahoo.com> wrote in message
news:a6feda32.0310211350.220311a5@posting.google.c om...[color=blue]
> Sorry Tim i don't see how i can accomplish this using with your
> example....remember my session variable is updated on the server
> so....can you please explain a little bit more?
> "Tim Williams" <saxifrax@pacbellremovethis.net> wrote in message[/color]
news:<eSX2xTAmDHA.3256@tk2msftngp13.phx.gbl>...[color=blue][color=green]
> > on the client using setinterval:
> >
> > var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
> > Date()));
> >
> > have updatesession.asp do the update to the session variable and then
> > redirect to a 1x1 gif or something.
> > The querystring part will force the browser to always make the request
> > instead of using the cache.
> >
> >
> > Tim.
> >
> >
> >
> > "Karen" <> wrote in message
> > news:a6feda32.0310210730.311e9e0b@posting.google.c om...[color=darkred]
> > > Hi there....
> > > i got a quick one for you guys. i've this session variable that is
> > > updated by calling a server method (i set this value when the user
> > > hits a submit button in my form. The server method is called when i
> > > load all my asp forms.). I'd like to be able to update this session
> > > variable, without being forced to submit my form or refresh my form
> > > (something that will call my server method each 2 min lets say,
> > > without refreshing my page or submit)...is there anyway to do this???
> > > Maybe a remote scripting with the setinterval() method?? but i'm
> > > having trouble using this with XP and IE 6 !!
> > >
> > > Your help is with this matter is higly appreciated!![/color][/color][/color]


Karen
Guest
 
Posts: n/a
#9: Jul 19 '05

re: QUESTION ON SESSION VARIABLES


Ok Tim! let me try this and i'll let you know...thanks a lot!
"Tim Williams" <saxifrax@pacbellremovethis.net> wrote in message news:<#dtdVbDmDHA.1096@TK2MSFTNGP11.phx.gbl>...[color=blue]
> Karen,
>
> If you want to run code on the server from the client, you must make a
> request. One way to do this is to submit a form - which you *don't* want to
> do - an another is to make a reqest by creating an image and setting its src
> attribute to an asp page. This asp page has access to the user's session,
> so it can update the session variable before returning the image to the
> client.
>
> ################### client
> <HTML>
> <HEAD>
> <TITLE> Session Update </TITLE>
>
> <script>
> var imgURL="http://myserver/updatesession.asp";
> var iCount=0;
> var tOut;
>
> function doUpdate(){
> iCount++;
> var img=new Image();
> img.src=imgURL+"?blah="+escape(new Date())
> img=null;
> document.getElementById("dMsg").innerHTML="Updated : "+iCount;
> tOut=window.setTimeout("doUpdate()",2000);
> }
> </script>
> </HEAD>
>
> <BODY onload="doUpdate();">
> <div id='dMsg'></div>
> </BODY>
> </HTML>
>
> ################ server (updatesession.asp)
>
> <%
>
> session("your_name")=session("your_name")+1
> response.redirect "tiny.gif"
>
> %>
>
> OK?
>
> Tim
>
> "Karen" <bambina_carina@yahoo.com> wrote in message
> news:a6feda32.0310211350.220311a5@posting.google.c om...[color=green]
> > Sorry Tim i don't see how i can accomplish this using with your
> > example....remember my session variable is updated on the server
> > so....can you please explain a little bit more?
> > "Tim Williams" <saxifrax@pacbellremovethis.net> wrote in message[/color]
> news:<eSX2xTAmDHA.3256@tk2msftngp13.phx.gbl>...[color=green][color=darkred]
> > > on the client using setinterval:
> > >
> > > var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
> > > Date()));
> > >
> > > have updatesession.asp do the update to the session variable and then
> > > redirect to a 1x1 gif or something.
> > > The querystring part will force the browser to always make the request
> > > instead of using the cache.
> > >
> > >
> > > Tim.
> > >
> > >
> > >
> > > "Karen" <> wrote in message
> > > news:a6feda32.0310210730.311e9e0b@posting.google.c om...
> > > > Hi there....
> > > > i got a quick one for you guys. i've this session variable that is
> > > > updated by calling a server method (i set this value when the user
> > > > hits a submit button in my form. The server method is called when i
> > > > load all my asp forms.). I'd like to be able to update this session
> > > > variable, without being forced to submit my form or refresh my form
> > > > (something that will call my server method each 2 min lets say,
> > > > without refreshing my page or submit)...is there anyway to do this???
> > > > Maybe a remote scripting with the setinterval() method?? but i'm
> > > > having trouble using this with XP and IE 6 !!
> > > >
> > > > Your help is with this matter is higly appreciated!![/color][/color][/color]
Closed Thread