QUESTION ON SESSION VARIABLES

Ask a Question related to ASP, Design and Development.

  1. #1

    Default QUESTION ON SESSION VARIABLES

    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!!
    Karen Guest

  2. Similar Questions and Discussions

    1. #39833 [NEW]: Session variables overwritten by local variables (register_globals=off)
      From: sup1382 at accedo dot es Operating system: OpenBSD 3.9 PHP version: 5.2.0 PHP Bug Type: Session related Bug...
    2. #39447 [NEW]: Want to optionally handle apc_upload_progress variables using session variables
      From: krudtaa at yahoo dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug...
    3. Another Session Variables question
      Hi Rod, If you're crossing application boundaries, you won't be able to share session state. You can, however, send along some information in a...
    4. Session problem when setting session variables in files that are in different directories
      I am running PHP 4.3.0 on a WinXPpro machine and I recently got problem with sessions. What I am building is a loginsystem and I need to save...
    5. variables that change session variables
      Hi, I'm currently writing a mulit-page form app that uses a session to retain data from each form element in order for the user to jump between...
  3. #2

    Default Re: Question on sessionvariables


    "Karen" <bambina_carina@yahoo.com> 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???
    No. The only "something" that can update the session is the client. In the
    simple world, anyway.

    Ray at work


    Ray at Guest

  4. #3

    Default 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...
    > 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!!

    Michel Thiffault Guest

  5. #4

    Default 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...
    > 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...
    > > 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!!
    >
    >

    Michel Thiffault Guest

  6. #5

    Default 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...
    > 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!!

    Tim Williams Guest

  7. #6

    Default 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>...
    > 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!!
    Karen Guest

  8. #7

    Default 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>...
    > 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...
    > > 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...
    > > > 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!!
    > >
    > >
    Karen Guest

  9. #8

    Default 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...
    > 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>...
    > > 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!!

    Tim Williams Guest

  10. #9

    Default 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>...
    > 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...
    > > 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>...
    > > > 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!!
    Karen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139