Dynamic-CD
Search : 
  Powered by FindinSite

ASP Documentation
Overview
• Introduction
• Getting started
• Dynamic-CD wizard
Passwords & Encryption
• Overview
• Example 1
• Example 2
Scripts
• The script language
• Script examples
• Database scripts
Technical details
• Applications
• Built-in objects
• Character Encoding
• Cookies
• Database CDs
• Development tips
• FAQs
• Future developments
• Global.asa
• Network support
• Object registration
• Resources
• ScriptingContext
• Server-side includes
• Sessions
• Technical limits
    
Dynamic-CD Cookies

Cookies are normally passed between browser and server in HTTP headers. If the user has Cookies switched off, Cookies become useless.

Dynamic-CD Cookies are, however, stored directly on the user's hard disk, by-passing the browser. This overcomes the difficulties with Cookies and allows small amounts of information to be stored between sessions.

The names of Cookies and Keys are case insensitive while the values they store are case sensitive. Cookies are ordered by order of creation. Keys are ordered by reverse order of creation.

For an example of cookies in use, see Script example 3. See also the Cookies test centre.


Cookies and keys
Setting, accessing and enumerating Cookies and Keys are supported, providing the following functionality :
<%
  Response.Write "Number of cookies = "
  Response.Write Request.Cookies.Count
  FOR EACH thing IN Request.Cookies
    IF Request.Cookies( thing).HasKeys THEN
      Response.Write "<BR>Number of keys = "
      Response.Write Request.Cookies(thing).Count
      FOR EACH key IN Request.Cookies( thing)
        Response.Write "<BR>" + thing
        Response.Write "(" + key + ") = "
        Response.Write Request.Cookies( thing)(key)
      NEXT
    ELSE
      Response.Write "<BR>" + thing + " = " 
      Response.Write Request.Cookies( thing)
    END IF
  NEXT
%>
Cookies can also be set, accessed and enumerated by index :
<%
  numCookies = Request.Cookies.Count
  FOR ii = 1 TO numCookies
    IF Request.Cookies( ii).HasKeys THEN
      numKeys = Request.Cookies( ii).Count
      FOR jj = 1 TO numKeys 
        Response.Write "<BR>" + cstr( ii)
        Response.Write "(" + cstr( jj) + ") = "
        Response.Write Request.Cookies( ii)(jj)
      NEXT
    ELSE
      Response.Write "<BR>" + cstr( ii) + " = " 
      Response.Write Request.Cookies( ii)
    END IF
  NEXT
%>

The names of Cookies and the names of their keys can be enumerated :

<%
  FOR ii = 1 to Request.Cookies.Count
    IF Request.Cookies( ii).haskeys THEN
      FOR jj = 1 to Request.Cookies( ii).Count
        Response.Write "<BR>"+cstr( ii)+"("+cstr( jj) &_
            ") ~ "+Request.Cookies( ii).Key(jj)
      NEXT
    ELSE
      Response.Write "<BR>"+cstr( ii)+" ~ " &_
            Request.Cookies.Key( ii)
    END IF
  NEXT
%>


Cookies.Expires
Cookies without an expiry date disappear when Dynamic-CD is terminated. Cookies with an expiry date later than the current time are retained.
Note that the expiry date must be written using US English format (Locale Identifier code 1033).


Cookies.Domain
Cookie Domains are set by Dynamic-CD to the same value as the realm parameter set by Dynamic-CD-Wizard. This keeps cookies generated by different Dynamic-CDs separate.

If you try to set the domain parameter by hand :

<%
  Response.Cookies( "myCookie") = "myCookieVal"
  Response.Cookies( "myCookie").domain = "myDomain"
%>
the value will be ignored and a warning will be generated in debug mode.


Cookies.Path and Cookies.Secure
The Path and Secure values are currently ignored.



 
   Home     Purchase     Licenses     Limitations     Version details     Site map     Contact     Copyright © 2000-2016 phdcc

  Dynamic-CD : the web server on CD Learn more | What's new