Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Retrieve Session variables on Client side?


Message #1 by "Chris Chaffee" <chris@u...> on Wed, 21 Feb 2001 19:53:47 -0800
Is it possible to see the contents of session variables on the client

side (maybe using JavaScript or something of the sort)? 



I'm trying to build a script around an existing external (not mine) web

site that uses the Session for authentication, and I need to be able to

pass the session information around between my scripts so I can interact

with the external site.



I know the information must be stored on the client somewhere, but I

can't figure out how to access it.



Thanks,



Chris Chaffee

Webmaster

UNX, Inc.

Member NASD/SIPC

chris@u...

Message #2 by "Ken Schaefer" <ken@a...> on Thu, 22 Feb 2001 22:14:34 +1100

> Is it possible to see the contents of session variables on the client

> side (maybe using JavaScript or something of the sort)? 

>

> I'm trying to build a script around an existing external (not mine) web

> site that uses the Session for authentication, and I need to be able to

> pass the session information around between my scripts so I can interact

> with the external site.

>

> I know the information must be stored on the client somewhere, but I

> can't figure out how to access it.



Are you saying that you think the session information is stored on the

client? It's not...only a sessionID is stored in a cookie on the client. The

server holds onto all the session variables in the server's memory. the

client returns the cookie with the sessionID back to the server, the server

uses the sessionID to work out which variables are associated with that

user.



Cheers

Ken



Message #3 by "Paula Durán Trejos" <paudurtr@h...> on Thu, 22 Feb 2001 08:42:11 -0600
Try this



<%

Session("Answer") = "Yes"

%>



<script language=VBScript>

msgbox "<%=Session("Answer")%>"

</script>



>From: "Chris Chaffee" <chris@u...>

>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>

>To: "ASP Web HowTo" <asp_web_howto@p...>

>Subject: [asp_web_howto] Retrieve Session variables on Client side?

>Date: Thu, 22 Feb 2001 06:56:14 -0800

>

>Is it possible to see the contents of session variables on the client

>side (maybe using JavaScript or something of the sort)? 

>

>I'm trying to build a script around an existing external (not mine) web

>site that uses the Session for authentication, and I need to be able to

>pass the session information around between my scripts so I can interact

>with the external site.

>

>I know the information must be stored on the client somewhere, but I

>can't figure out how to access it.

>

>Thanks,

>

>Chris Chaffee

>Webmaster

>UNX, Inc.

>Member NASD/SIPC

>chris@u...

>
Message #4 by "Chris Chaffee" <chris@u...> on Thu, 22 Feb 2001 08:31:44 -0800
Good enough.  It sounds like I just need to be able to identify myself

to the server by returning the correct cookie.  Thanks!



-----Original Message-----

From: Ken Schaefer [mailto:ken@a...]

Sent: Thursday, February 22, 2001 3:15 AM

To: ASP Web HowTo

Subject: [asp_web_howto] Re: Retrieve Session variables on Client side?







> Is it possible to see the contents of session variables on the client

> side (maybe using JavaScript or something of the sort)? =3D20

>

> I'm trying to build a script around an existing external (not mine)

web

> site that uses the Session for authentication, and I need to be able

to

> pass the session information around between my scripts so I can

interact

> with the external site.

>

> I know the information must be stored on the client somewhere, but I

> can't figure out how to access it.



Are you saying that you think the session information is stored on the

client? It's not...only a sessionID is stored in a cookie on the client.

The

server holds onto all the session variables in the server's memory. the

client returns the cookie with the sessionID back to the server, the

server

uses the sessionID to work out which variables are associated with that

user.



Cheers

Ken

Message #5 by "Ken Schaefer" <ken@a...> on Fri, 23 Feb 2001 14:17:35 +1100
The problem with cookies is that you can not get the values set by another

server (you mentioned that the other server was external to yours).



Ie, if server1 sets a cookie, you can not retrieve this on server2, unless

they are both in the same domain, and the original server says that the

cookie can be accessed by all machines in the domain. That said, session

cookies are not domain wide - they will only be returned to the server that

set them.



Cheers

Ken



----- Original Message -----

From: "Chris Chaffee" <chris@u...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Friday, February 23, 2001 3:31 AM

Subject: [asp_web_howto] Re: Retrieve Session variables on Client side?





Good enough.  It sounds like I just need to be able to identify myself

to the server by returning the correct cookie.  Thanks!



-----Original Message-----

From: Ken Schaefer [mailto:ken@a...]

Sent: Thursday, February 22, 2001 3:15 AM

To: ASP Web HowTo

Subject: [asp_web_howto] Re: Retrieve Session variables on Client side?







> Is it possible to see the contents of session variables on the client

> side (maybe using JavaScript or something of the sort)? 

>

> I'm trying to build a script around an existing external (not mine)

web

> site that uses the Session for authentication, and I need to be able

to

> pass the session information around between my scripts so I can

interact

> with the external site.

>

> I know the information must be stored on the client somewhere, but I

> can't figure out how to access it.



Are you saying that you think the session information is stored on the

client? It's not...only a sessionID is stored in a cookie on the client.

The

server holds onto all the session variables in the server's memory. the

client returns the cookie with the sessionID back to the server, the

server

uses the sessionID to work out which variables are associated with that

user.



Cheers

Ken








  Return to Index