ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / HTTP functions
  • Properties specific to Cookie variables
  • Functions that use Cookie variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The Cookie type is used to handle the cookies transmitted in the HTTP requests. Cookie characteristics can be defined and modified using various WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Relecture des cookies de la session précédente
MesCookies is array of Cookie
Deserialize(MesCookies, fLoadText("MesCookies.xml"), psdXML)

// Activation de la gestion des cookies
HTTPCookieManage(True)
HTTPCookieReplace(".yahoo.com", MesCookies)

// Requête (les cookies seront envoyés au serveur Web)
HTTPRequest("www.yahoo.com")
Properties

Properties specific to Cookie variables

The following properties can be used to handle a Cookie:
Property nameType usedEffect
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.
PathCharacter stringValidity path of cookie.
Indicates to the server the URLs on which the cookie must be interpreted.
ValueCharacter stringValue of cookie.
Remarks:
  • 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.
Remarks

Functions that use Cookie variables

HTTPCookieGetRetrieves the cookies read by a call:
HTTPCookieReplaceReplaces all the cookies stored for a domain:
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help