home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Session_JScript.asp < prev    next >
Text File  |  1997-10-25  |  1KB  |  52 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <%
  4.     // Ensure that this page is not cached
  5.     Response.Expires = 0;
  6. %>
  7.  
  8. <HTML>
  9.     <HEAD>
  10.         <TITLE>Using Session Variables</TITLE>
  11.     </HEAD>
  12.  
  13.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  14.  
  15.         <!-- Display Header -->
  16.  
  17.         <font size="4" face="Arial, Helvetica">
  18.         <b>Using Session Variables</b></font><br>
  19.       
  20.         <hr size="1" color="#000000">
  21.  
  22.         <%
  23.             // If this is the first time a user has visited
  24.             // the page, initialize Session Value
  25.  
  26.             if (Session("SessionCountJScript") == null) 
  27.             {
  28.                 Session("SessionCountJScript") = 0;
  29.             }
  30.  
  31.  
  32.             // Increment the Session PageCount by one.
  33.             // Note that this PageCount value is only
  34.             // for this user's individual session
  35.  
  36.             Session("SessionCountJScript") = Session("SessionCountJScript") + 1;
  37.         %>
  38.  
  39.  
  40.         <!-- Output the Session Page Counter Value -->
  41.  
  42.         You have personally visited this page 
  43.         <%=Session("SessionCountJScript")%> times.
  44.  
  45.  
  46.         <!-- Provide a link to revisit the page -->
  47.  
  48.         <p><A href = "Session_JScript.asp">Click here to visit it again</A>
  49.  
  50.     </BODY>
  51. </HTML>
  52.