The purpose of Cookie concept is to assist the navigation and retrieval
process in the exploration of the hidden web (dynamically generated
web pages).
This is achieved through:
- The use of some specific parameters contained in cookies returned
as a result of a HTTP query to dynamically
generate URL's for further navigation. Accessing dynamically
generated pages, pages which assumes as parameter a UIN send in a
cookie, for example.
- Creating some artificial cookies and using them to access
personalized pages. As example, the http://my.yahoo.com page, is
generated depending on some information contained in the cookies
headers send in the request.
The Cookie concept does not have any special methods. These concepts are
created automaticaly by the HTTP handler from the HTTP headers and
stored in the mem://hyper/http/cookies/ memory context as a Series , and
should be seen only as bags of information.
Cookie can be also created by users and stored in the same memory
context in order to automatize / customize the navigation process on
some specific sites.
assume that we have a Series containing cookies and serialized somewhere.
Now we load them
# create a new cookie concept
$jguru_cookie TYPEOF Cookie
# we want automatic login
$jguru_cookie@name = "auto_login_mchale"
$jguru_cookie@value = "TRUE"
$jguru_cookie@domain = "www.jguru.com"
$jguru_cookie@path = "/"
$jguru_cookie.storeCookie
# we have also to have our UIN
$jguru_cookie@name = "unique_id"
$jguru_cookie@value = "9698986dfdd9dsid98423..."
$jguru_cookie@domain = "www.jguru.com"
$jguru_cookie@path = "/"
$jguru_cookie.storeCookie
# now we can go to our homepage at jguru.com
$page FROM "http://www.jguru.com"
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
Label: | domain |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
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.
Label: | expires |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
The expires attribute specifies a date string that defines the valid
life time of that cookie. Once the expiration date has been reached,
the cookie will no longer be stored or given out.
Label: | name |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
This string is a sequence of characters excluding semi-colon, comma and
white space. If there is a need to place such data in the name or value,
some encoding method such as URL style %XX encoding is recommended,
though no encoding is defined or required.
Label: | path |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
The path attribute is used to specify the subset of URLs in a domain for
which the cookie is valid. If a cookie has already passed domain
matching, then the pathname component of the URL is compared with the
path attribute, and if there is a match, the cookie is considered valid
and is sent along with the URL request. The path "/foo" would match
"/foobar" and "/foo/bar.html". The path "/" is the most general path.
Label: | secure |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
If a cookie is marked secure, it will only be transmitted if the
communications channel with the host is a secure one. Currently this
means that secure cookies will only be sent to HTTPS (HTTP over SSL)
servers. If secure is not specified, a cookie is considered safe to be
sent in the clear over unsecured channels.
Label: | value |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
This string is a sequence of characters excluding semi-colon, comma and
white space. If there is a need to place such data in the name or value,
some encoding method such as URL style %XX encoding is recommended,
though no encoding is defined or required.
Parameters: |
$cookieContent : | The content of this Cookie. |
$domain : | The domain. |
|
Constructs a new Cookie concept with the specified content and domain.
Constructs a new empty Cookie concept.
Parameters: |
$cookieFile : | The cookie file to convert. |
$cookieDir : | The directory in which the converted cookie will be placed. |
|
Converts the specified eplorer cookie file to xml files and put them in
the specified directory.
Cookie.convertExplorerCookies("C:\windows\Cookies\", "/home/user/cookies/")
Parameters: |
$cookieFile : | The cookie file to convert. |
$cookieDir : | The directory in which the converted cookie will be placed. |
|
Converts the specified konqueror cookie file to xml files and put them
in the specified directory.
Cookie.convertExplorerCookies("/home/user/.kde/share/apps/kcookiejar/cookies", "/home/user/cookies/")
Parameters: |
$cookieFile : | The cookie file to convert. |
$cookieDir : | The directory in which the converted cookie will be placed. |
|
Converts the specified netscape cookie file to xml files and put them
in the specified directory.
Cookie.convertNetscapeCookies("/home/user/.netscape/cookies", "/home/user/cookies/")
Parameters: |
$cookieFile : | The cookie file to convert. |
$cookieDir : | The directory in which the converted cookie will be placed. |
|
Converts the specified opera cookie file to xml files and put them in
the specified directory.
Cookie.convertExplorerCookies("/home/user/.opera/cookies4.dat", "/home/user/cookies/")
Exceptions: |
badURLException :
(Error) |
If the URL to the search the cookie isn't valid. |
Returns a String concept with all cookies from user's home directory
which contains the specified uri.
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
$cookie.setExpires("1027358757935")
$cookie.setName("google_settings")
$cookie.setPath("/")
$cookie.setSecure("FALSE")
$cookie.setValue("OrZettS7zZIAADc4y3U")
$cookie.storeCookie
print Cookie.getCookieString("http://www.google.com")
-- the result is --
google_settings=OrZettS7zZIAADc4y3U
Exceptions: |
badURLException :
(Error) |
If the URL to the search the cookie isn't valid. |
Returns a Series concept with all cookies as Cookie concepts from user's
home directory which contains the specified uri.
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
$cookie.setExpires("1027358757935")
$cookie.setName("google_settings")
$cookie.setPath("/")
$cookie.setSecure("FALSE")
$cookie.setValue("OrZettS7zZIAADc4y3U")
$cookie.storeCookie
print Cookie.getCookiesFromDB("http://www.google.com")
-- the result is --
Name : google_settings
Value : OrZettS7zZIAADc4y3U
Domain : www.google.com
Path : /
Expires: 1027358757935
Secure : FALSE
Parameters: |
$saveDir : | The directory in which will be saved this cookie. |
|
Saves this cookie concept to the specified directory.
$cookie typeof Cookie
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
$cookie.setExpires("1027358757935")
$cookie.setName("google_settings")
$cookie.setPath("/")
$cookie.setSecure("FALSE")
$cookie.setValue("OrZettS7zZIAADc4y3U")
$cookie.saveCookie("/home/user/cookies/")
Parameters: |
$newDomain : | The new domain to be set. |
|
Sets this cookie domain to the value specified in parameter.
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
print $cookie
-- the result is --
Name :
Value :
Domain : www.google.com
Path :
Expires:
Secure :
Parameters: |
$expires : | The new expiration to be set. |
|
Sets this cookie expiration to the value given as parameter.
$cookie typeof Cookie
$cookie.setExpires("1027358757935")
print $cookie
-- the result is --
Name :
Value :
Domain :
Path :
Expires: 1027358757935
Secure :
Parameters: |
$newName : | The new name to be set. |
|
Sets this cookie name to the value given as parameter.
$cookie typeof Cookie
$cookie.setName("google_settings")
print $cookie
-- the result is --
Name : google_settings
Value :
Domain :
Path :
Expires:
Secure :
Parameters: |
$newPath : | The new path to be set. |
|
Sets this cookie path to the value given as parameter.
$cookie typeof Cookie
$cookie.setPath("/")
print $cookie
-- the result is --
Name :
Value :
Domain :
Path : /
Expires:
Secure :
Parameters: |
$secure : | The new secure to be set. |
|
Sets this cookie secure to the value given as parameter.
$cookie typeof Cookie
$cookie.setSecure("TRUE")
print $cookie
-- the result is --
Name :
Value :
Domain :
Path :
Expires:
Secure : TRUE
Parameters: |
$newValue : | The new value to be set. |
|
Sets this cookie value to the value given as parameter.
$cookie typeof Cookie
$cookie.setValue("OrZettS7zZIAADc4y3U")
print $cookie
-- the result is --
Name :
Value : OrZettS7zZIAADc4y3U
Domain :
Path :
Expires:
Secure :
Saves this cookie concept to the user's home directory.
$cookie typeof Cookie
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
$cookie.setExpires("1027358757935")
$cookie.setName("google_settings")
$cookie.setPath("/")
$cookie.setSecure("FALSE")
$cookie.setValue("OrZettS7zZIAADc4y3U")
$cookie.storeCookie
Returns a stream representing the simple text rendering of this concept.
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
$cookie.setExpires("1027358757935")
$cookie.setName("google_settings")
$cookie.setPath("/")
$cookie.setSecure("TRUE")
$cookie.setValue("OrZettS7zZIAADc4y3U")
print $cookie.toTXT
-- the result is --
Name : google_settings
Value : OrZettS7zZIAADc4y3U
Domain : www.google.com
Path : /
Expires: 1027358757935
Secure : TRUE
Returns a stream representing the XML rendering of this concept.
$cookie typeof Cookie
$cookie.setDomain("www.google.com")
$cookie.setExpires("1027358757935")
$cookie.setName("google_settings")
$cookie.setPath("/")
$cookie.setSecure("TRUE")
$cookie.setValue("OrZettS7zZIAADc4y3U")
print $cookie.toXML
-- the result is --
<?xml version="1.0"?>
<cookie version="0">
<domain>www.google.com</domain>
<path>/</path>
<secure>TRUE</secure>
<expires>1027358757935</expires>
<name>google_settings</name>
<value>OrZettS7zZIAADc4y3U</value>
</cookie>