;;; sec9.mhtml: -*- Meta-HTML -*- 

;;;  Copyright (c) 1996 Universal Access Inc.
;;;  Author: Henry Minsky (hqm@ua.com) Sun Sep 15 11:06:55 1996.
<set-var title="Server Variables">
<include header.mhtml>

<plain-text>
  <pagelist-control-panel>
  <h2>Variables Predefined by <meta-html></h2>

  <a name="server-variables"></a>
  Several variables are predefined by <meta-html>, and made available to
  the page writer.  In addition to the contents of the Unix environment
  (which includes the server-side variables ENV::SERVER_NAME, ENV::PATH_INFO,
  etc.) variables describing the location of the current document in
  various ways are also defined.

  When the URL is ``<i><get-var mhtml::full-url></i>'', the following
  variables are set to:

  <table>
    <tr>
      <td align=right><b>MHTML::PATH-INFO</b></td>
      <td><i><get-var mhtml::path-info></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::HTTP-TO-HOST</b></td>
      <td><i><get-var mhtml::http-to-host></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::CURRENT-DOC</b></td>
      <td><i><get-var mhtml::current-doc></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::INCLUDE-PREFIX</b></td>
      <td><i><get-var mhtml::include-prefix></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::RELATIVE-PREFIX</b></td>
      <td><i><get-var mhtml::relative-prefix></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::LOCATION</b></td>
      <td><i><get-var mhtml::location></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::LOCATION-SANS-SID</b></td>
      <td><i><get-var mhtml::location-sans-sid></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::FULL-URL</b></td>
      <td><i><get-var mhtml::full-url></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::FULL-URL-SANS-SID</b></td>
      <td><i><get-var mhtml::full-url-sans-sid></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::URL-TO-DIR</b></td>
      <td><i><get-var mhtml::url-to-dir></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::URL-TO-DIR-SANS-SID</b></td>
      <td><i><get-var mhtml::url-to-dir-sans-sid></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::HTTP-PREFIX</b></td>
      <td><i><get-var mhtml::http-prefix></i><br></td>
    </tr>
    <tr>
      <td align=right><b>MHTML::HTTP-PREFIX-SANS-SID</b></td>
      <td><i><get-var mhtml::http-prefix-sans-sid></i><br></td>
    </tr>
  </table>

  And, the following variables have special meaing to the <meta-html>
  Server and CGI Engine:

  <ul>
    <li> <b>MHTML::COOKIE-COMPATIBLE</b><br>
    This variable is set when the connected browser/server combination
    understands HTTP Cookies, and is non-existent otherwise.  You might
    use this variable to determine in which way to best create a
    session; see <a href="<get-var mhtml::url-to-dir>/sessions.mhtml">
    Sessions and State</a> for more information.

    <li> <b>MHTML::UNPARSED-HEADERS</b><br>
    This variable is set when either the <meta-html> Server is being
    used, or the <meta-html> CGI Engine has been configured as an "nph"
    CGI (that is, the server will not parse the headers returned by the
    CGI Engine).  The knowledge is useful in determining what types of
    extra MIME headers to return from a particular document, or when
    deciding to use the <code>server-push</code> command or not.

    <li> <b>MTHML::CACHEABLE</b><br>
    Setting this variable controls the expiration date of the returned
    page.  Normal operation of the Server or CGI Engine is to expire all
    <meta-html> pages sometime in the past, thus telling the browser
    that the document information must be fetched again when the URL is
    looked up.  If the information that you are returning in a
    particular page is relatively static, setting this variable causes
    either the Server or CGI Engine to return an expiration date
    sometime in the future.  This allows browsers and proxies to cache
    the page for future requests.

    <li> <b>MHTML::SID-PREFIX</b><br>
    When this variable is present, the <code>PATH</code> component of
    a returned <code>Set-Cookie</code> MIME header is set to its value.
    Normally, the value of <code>MHTML::RELATIVE-PREFIX</code> is used.

    If you need to use <code>MHTML::SID-PREFIX</code>, you probably have
    a very complex directory structure, and the need for every page
    access to have a cookie associated with it.  In this case, setting
    <code>MHTML::SID-PREFIX</code> will have the effect of flattening
    your directory structure in the browser's view.

    Generally, correctly written <meta-html> applications do not need to
    use this variable, and it might be used in only the most complicated
    of Web sites, with multiple sessions per connectee, etc.

    The explanation of HTTP Cookies is beyond the scope of this
    document.  Reference information on Cookies can be found through
    <a href="http://home.netscape.com/newsref/std/cookie_spec.html">
    this link.</a>
    <ul>

      <pagelist-control-panel>
    </plain-text>
    <include footer.mhtml>
