[Javascript] Mimicking session state

Rees, Mark (TWIi London) mrees at twii.net
Tue May 1 07:15:02 CDT 2001


Yes, that's true. However it doesn't help me track sessions any more
accurately.
 
Server-side scripting is out of the question (shame as an ASP session
variable for example would solve this problem in no time), so my current
proposal is to use document.referrer, and check it to see if it contains an
URL from within the site. If not, then it's a new session so I show a new
picture and write/update the cookie, otherwise keep the old image.
 
Seems to work OK so far...any comments?
 
Mark
 
 
 
 -----Original Message-----
From: Filipiak, Bob (Contractor) [mailto:filipiab at atsc.army.mil]
Sent: 01 May 2001 12:59
To: 'javascript at LaTech.edu'
Subject: RE: [Javascript] Mimicking session state



That is one of the primary uses of cookies, to check if a visitor has been
here before and when. The history object is intended for browser navigation.
Another solution would be to track the visit server side. 

Bob Filipiak (Contractor) 
MCP 

-----Original Message----- 
From: Rees, Mark (TWIi London) [ mailto:mrees at twii.net
<mailto:mrees at twii.net> ] 
Sent: Tuesday, May 01, 2001 6:36 AM 
To: 'javascript at LaTech.edu' 
Subject: [Javascript] Mimicking session state 


Hello 

I have to attempt to track sessions using client-side code only. The idea is

that every time a user visits the site, they see a new picture. Thus far the

only way I can see to mimick this is to set a cookie storing the image name,

and update it if more than a set period of time (say an hour) has elapsed 
since the cookie was set. 

I had hoped to use the history object but all the most useful properties 
(like next and previous) are quite rightly not available in most 
environments. 

Does anyone have any other ideas? 

Thanks in advance 

Mark 

_______________________________________________ 
Javascript mailing list 
Javascript at LaTech.edu 
http://www.LaTech.edu/mailman/listinfo/javascript
<http://www.LaTech.edu/mailman/listinfo/javascript>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010501/393b2dc0/attachment.htm>


More information about the Javascript mailing list