<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>RE: [Javascript] Mimicking session state</TITLE>

<META content="MSHTML 6.00.2462.0" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff size=2>Yes, 
that's true. However it doesn't help me track sessions any more 
accurately.</FONT></SPAN></DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff 
size=2>Server-side scripting is out of the question (shame as an 
ASP&nbsp;session variable for example&nbsp;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.&nbsp;If not, then it's a new session so I 
show a new picture and write/update the cookie, otherwise keep the old 
image.</FONT></SPAN></DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff size=2>Seems 
to work OK so far...any comments?</FONT></SPAN></DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff 
size=2>Mark</FONT></SPAN></DIV>
<DIV><SPAN class=858161012-01052001><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=858161012-01052001></SPAN><SPAN 
class=858161012-01052001></SPAN><FONT face=Tahoma><FONT size=2><SPAN 
class=858161012-01052001><FONT face=Arial 
color=#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN 
class=858161012-01052001></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN 
class=858161012-01052001>&nbsp;</SPAN>-----Original Message-----<BR><B>From:</B> 
Filipiak, Bob (Contractor) [mailto:filipiab@atsc.army.mil]<BR><B>Sent:</B> 01 
May 2001 12:59<BR><B>To:</B> 'javascript@LaTech.edu'<BR><B>Subject:</B> RE: 
[Javascript] Mimicking session state<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <P><FONT size=2>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. 
  </FONT></P>
  <P><FONT size=2>Bob Filipiak (Contractor)</FONT> <BR><FONT size=2>MCP 
  </FONT></P>
  <P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: Rees, 
  Mark (TWIi London) [<A 
  href="mailto:mrees@twii.net">mailto:mrees@twii.net</A>]</FONT> <BR><FONT 
  size=2>Sent: Tuesday, May 01, 2001 6:36 AM</FONT> <BR><FONT size=2>To: 
  'javascript@LaTech.edu'</FONT> <BR><FONT size=2>Subject: [Javascript] 
  Mimicking session state</FONT> </P><BR>
  <P><FONT size=2>Hello</FONT> </P>
  <P><FONT size=2>I have to attempt to track sessions using client-side code 
  only. The idea is</FONT> <BR><FONT size=2>that every time a user visits the 
  site, they see a new picture. Thus far the</FONT> <BR><FONT size=2>only way I 
  can see to mimick this is to set a cookie storing the image name,</FONT> 
  <BR><FONT size=2>and update it if more than a set period of time (say an hour) 
  has elapsed</FONT> <BR><FONT size=2>since the cookie was set. </FONT></P>
  <P><FONT size=2>I had hoped to use the history object but all the most useful 
  properties</FONT> <BR><FONT size=2>(like next and previous) are quite rightly 
  not available in most</FONT> <BR><FONT size=2>environments.</FONT> </P>
  <P><FONT size=2>Does anyone have any other ideas?</FONT> </P>
  <P><FONT size=2>Thanks in advance</FONT> </P>
  <P><FONT size=2>Mark</FONT> </P>
  <P><FONT size=2>_______________________________________________</FONT> 
  <BR><FONT size=2>Javascript mailing list</FONT> <BR><FONT 
  size=2>Javascript@LaTech.edu</FONT> <BR><FONT size=2><A 
  href="http://www.LaTech.edu/mailman/listinfo/javascript" 
  target=_blank>http://www.LaTech.edu/mailman/listinfo/javascript</A></FONT> 
</P></BLOCKQUOTE></BODY></HTML>