Updating Session Variables with Client-Side code? 
Author Message
 Updating Session Variables with Client-Side code?

Has anyone ever needed to update a Session variable using
client-side code?  

I need to update a session variable, then redirect to the
same page, so there may be a better way to do this, I
don't know.  

Any ideas?

Thanks,
Scott



Thu, 15 Jan 2004 06:21:14 GMT  
 Updating Session Variables with Client-Side code?
How about

var tImg = new Image();
tImg.src="updateSession.asp?sessionVarName=sessionVarValue;

have your asp page end by redirecting to a small .gif file.

Tim.

Quote:

> Has anyone ever needed to update a Session variable using
> client-side code?

> I need to update a session variable, then redirect to the
> same page, so there may be a better way to do this, I
> don't know.

> Any ideas?

> Thanks,
> Scott



Thu, 15 Jan 2004 09:44:11 GMT  
 Updating Session Variables with Client-Side code?
Scott
   The best I've been able to come up with so far, is to
set a client side cookie in JScript using the setcookie
function.  I'm able to get at the cookie from the server
side then also as a regular cookie.  I hate cookies, but
this is the only thing I've been able to come up with so
far.
Hope that helps.
Quote:
>-----Original Message-----
>Has anyone ever needed to update a Session variable using
>client-side code?  

>I need to update a session variable, then redirect to the
>same page, so there may be a better way to do this, I
>don't know.  

>Any ideas?

>Thanks,
>Scott
>.



Fri, 16 Jan 2004 21:53:01 GMT  
 Updating Session Variables with Client-Side code?
Tim,

I like this idea. I have to make a return trip to the
server anyway, couldn't the updatesession.asp page do a
redirection back to the originating page?  Just an
enhancement thought...

Thanks for your input,
Scott

Quote:
>-----Original Message-----
>How about

>var tImg = new Image();
>tImg.src="updateSession.asp?

sessionVarName=sessionVarValue;
Quote:

>have your asp page end by redirecting to a small .gif
file.

>Tim.


>> Has anyone ever needed to update a Session variable
using
>> client-side code?

>> I need to update a session variable, then redirect to
the
>> same page, so there may be a better way to do this, I
>> don't know.

>> Any ideas?

>> Thanks,
>> Scott
>.



Sat, 17 Jan 2004 00:07:48 GMT  
 Updating Session Variables with Client-Side code?
Yes, I thought that may be the case.  We have
a "controlled" audience for the application we're working
on, so cookies will probably be ok.

Thanks for your idea!
Scott

Quote:
>-----Original Message-----
>Scott
>   The best I've been able to come up with so far, is to
>set a client side cookie in JScript using the setcookie
>function.  I'm able to get at the cookie from the server
>side then also as a regular cookie.  I hate cookies, but
>this is the only thing I've been able to come up with so
>far.
>Hope that helps.

>>-----Original Message-----
>>Has anyone ever needed to update a Session variable
using
>>client-side code?  

>>I need to update a session variable, then redirect to
the
>>same page, so there may be a better way to do this, I
>>don't know.  

>>Any ideas?

>>Thanks,
>>Scott
>>.

>.



Sat, 17 Jan 2004 00:10:02 GMT  
 Updating Session Variables with Client-Side code?

Quote:
> var tImg = new Image();
> tImg.src="updateSession.asp?sessionVarName=sessionVarValue;

Hey,

While this will work, you should be very wary of allowing people to set
Session variables with a URL... make sure you do some kind of validation,
and make sure they can't do something like setting a "LoggedIn" variable to
true or something like that...

Peter

--

JScript .NET / VSA Runtime Program Manager
Please post all questions to the group. Thanks.



Sun, 18 Jan 2004 08:01:10 GMT  
 Updating Session Variables with Client-Side code?
Peter,

Good point!!  No, I think since I have my objects in a
form, I'll interegate the form objects in the receiving
ASP page.  Also, as far as I'm concerned, log in
information should never be stored in Session variables.  
That could be very dangerous.

Thanks for your cautious eye and input,
Scott

Quote:
>-----Original Message-----

message

>> var tImg = new Image();
>> tImg.src="updateSession.asp?

sessionVarName=sessionVarValue;
Quote:

>Hey,

>While this will work, you should be very wary of allowing
people to set
>Session variables with a URL... make sure you do some
kind of validation,
>and make sure they can't do something like setting

a "LoggedIn" variable to
Quote:
>true or something like that...

>Peter

>--

>JScript .NET / VSA Runtime Program Manager
>Please post all questions to the group. Thanks.

>.



Sun, 18 Jan 2004 08:51:25 GMT  
 Updating Session Variables with Client-Side code?
Yes, I didn't mean that to be implemented as a "set any session variable" kind of thing,
merely to indicate that one page would be able to handle a number of different variables.

Tim

Quote:



> > var tImg = new Image();
> > tImg.src="updateSession.asp?sessionVarName=sessionVarValue;

> Hey,

> While this will work, you should be very wary of allowing people to set
> Session variables with a URL... make sure you do some kind of validation,
> and make sure they can't do something like setting a "LoggedIn" variable to
> true or something like that...

> Peter

> --

> JScript .NET / VSA Runtime Program Manager
> Please post all questions to the group. Thanks.



Sun, 18 Jan 2004 11:29:36 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Reading Session Variables from Client Side Script (functions)

2. Accessing Session Variables from Client side Javascript

3. Reading Session Variables from Client Side Script (functions)

4. Retreiving Session Variables in Client-side Script

5. change value of session variable in client side script

6. Changing values of session variables in client side script

7. CAB files not updating on client side when VBscript is updated

8. JScript code for both server side and client side

9. Uh ? Client side and Server side variables

10. Client-side to Server-side variable?

11. Passing variables from server-side to client-side

12. Passing variables from client-side to server-side

 

 
Powered by phpBB® Forum Software