× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The cookie specification has nothing to do with the platform
on which the CGI program runs or language in which the CGI
program is written.

It appears that you can set the cookie's domain name to
the full host name.  The following three paragraphs are
quoted from the cookie specification at         
  http://wp.netscape.com/newsref/std/cookie_spec.html

domain=DOMAIN_NAME

      When searching the cookie list for valid cookies, a comparison of
      the domain attributes of the cookie is
      made with the Internet domain name of the host
      from which the URL will be fetched. If there is a
      tail match, then the cookie will go through path
      matching to see if it should be sent. "Tail matching"
      means that domain attribute is matched against the
      tail of the fully qualified domain name of the host.
      A domain attribute of "acme.com" would match host
      names "anvil.acme.com" as well as "shipping.crate.acme.com".

      Only hosts within the specified domain can set a cookie
      for a domain and domains must have at least two (2) or
      three (3) periods in them to prevent domains of the form:
      ".com", ".edu", and "va.us". Any domain that fails within
      one of the seven special top level domains listed below
      only require two periods. Any other domain requires at least
      three. The seven special top level domains are: "COM", "EDU",
      "NET", "ORG", "GOV", "MIL", and "INT".

      The default value of domain is the host name of the
      server which generated the cookie response.

Note that the third paragraph states that the default domain name is
the host name, which in your example is mymachine.mydomain.com
In fact, mydomain.com would not be valid as a cookie's domain name
because it has only one period in it and at least two periods are required.

If you are interested in writing RPG CGI programs, I urge you to
look at the tools, including CGIDEV2, available for free from
IBM's Easy400 site:

http://www-922.ibm.com/


Mel Rothman, CGIDEV2 Author Mel Rothman, Inc.

Franco Finstad wrote:
Can I set/get a cookie with the full hostname, as in
machine.domain.com, in RPG-CGI?

I'm using HTTP Server Original on AS400/iSeries V5R2.

I've read that that I can only set/get cookies by
domain
name, as in mydomain.com, instead of
mymachine.mydomain.com. This seems like a very bad
limitation since all the hosts in my domain
(dev/test/production) will be forced to use the same
cookie.


Please advise.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.