PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of Cookie variables
  • Functions that use the Cookie variables
  • Limits
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
The Cookie type is used to handle the cookies transmitted in the HTTP requests. The characteristics of the cookies can be defined and modified by several WLanguage properties.
Note: See Declaring a variable for more details.
Versions 19 and later
Universal Windows 10 App This type of variable is now available for the applications in Windows Store Apps mode.
New in version 19
Universal Windows 10 App This type of variable is now available for the applications in Windows Store Apps mode.
Universal Windows 10 App This type of variable is now available for the applications in Windows Store Apps mode.
Versions 20 and later
iPhone/iPad This type of variable is now available for the iPhone/iPad applications.
New in version 20
iPhone/iPad This type of variable is now available for the iPhone/iPad applications.
iPhone/iPad This type of variable is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
New in version 22
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
Example
// Read the cookies of previous session again
MyCookies is array of Cookies
Deserialize(MyCookies, fLoadText("MyCookies.xml"), psdXML)

// Enable the management of cookies
HTTPCookieManage(True)
HTTPCookieReplace(".yahoo.com", MyCookies)

// Request (the cookies will be sent to the Web server)
HTTPRequest("www.yahoo.com")
Remarks

Properties specific to the description of Cookie variables

The following properties can be used to handle a Cookie:
Property nameType usedEffect
PathCharacter stringValidity path of cookie.
Indicates to the server the URLs on which the cookie must be interpreted.
CommentCharacter stringFree comment value associated with the cookie.
This property does not affect the HTTP requests.
DomainCharacter stringValidity domain of cookie.
The cookie will be sent into all HTTP requests whose domain ends with the validity domain of cookie.
For example, a cookie whose validity domain is ".mydomain.fr" will be sent during the following requests:
  • http://mydomain.fr
  • http://www.mydomain.fr/index.html
  • http://server.mydomain.fr/page.awp
It will not be sent in the following requests:
  • http://www.mydomain.com
  • http://otherdomain.fr
ExpirationCharacter string or
DateTime variable
Expiration date and time of cookie.
In most cases, this property is set by the Web server to avoid retrieving information that is too old in an HTTP request.
NameCharacter stringName of cookie.
This name is not case sensitive.
ValueCharacter stringValue of cookie.
Notes:
  • The value of a cookie is limited to 4KB. Beyond this size, the server is free to reject the cookie.
  • The control characters (TAB, CR, etc.) as well as the semicolon and the binary zeros are not allowed.

Note: These properties can be used with one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>

Functions that use the Cookie variables

Versions 15 and later
HTTPCookieGet
New in version 15
HTTPCookieGet
HTTPCookieGet
Retrieves the cookies read by a call:
Versions 15 and later
HTTPCookieReplace
New in version 15
HTTPCookieReplace
HTTPCookieReplace
Replaces all the cookies stored for a domain:
AndroidAndroid Widget

Limits

This type of variable is available for the devices equipped with ARM processors. A fatal error occurs if this type of variable is used with devices not equipped with ARM processors (x86, mips, ...). This type of variable is available for the devices equipped with ARM processors or using an ARM emulation. Otherwise (and on the Samsung Galaxy Tab 3 tablet), a fatal error will occur.
Minimum required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment