PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Adds or modifies a cookie in an HTTP request.
Two types of use are available:
  • If the request is run by HTTPRequest, HTTPCookieWrite must be called before HTTPRequest in order to set the value of cookies that will be sent to the HTTP server.
  • Versions 20 and later
    AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst If the query is executed with the HTTPSend function, the HTTPCookieWrite function must be executed directly on the variable of type HTTPRequest( syntax 2).
    New in version 20
    AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst If the query is executed with the HTTPSend function, the HTTPCookieWrite function must be executed directly on the variable of type HTTPRequest( syntax 2).
    AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst If the query is executed with the HTTPSend function, the HTTPCookieWrite function must be executed directly on the variable of type HTTPRequest( syntax 2).
Remark: The cookies read and sent by HTTPRequest are only stored in memory in the application. They are not related to the cookies of Web browsers installed on the computer.
Versions 20 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 20
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 22 and later
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
New in version 22
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Example
// Fixe la valeur d'un cookie d'identification avec une valeur mémorisée
HTTPCookieWrite("domaine.com", "ID", LoadParameter("ID"))
 
// Effectue une requête HTTP
HTTPRequest("www.MonSite.com?Login")
 
// Récupère et sauve la valeur du cookie renvoyée par le serveur
sID is string = HTTPCookieRead(".monsite.fr", "ID")
SaveParameter("ID", sID)
Syntax

Request run by HTTPRequest Hide the details

HTTPCookieWrite(<Domain> , <Name> , <Value>)
<Domain>: Character string
Validity 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
<Name>: Character string
Name of cookie.
This name is not case sensitive.
<Value>: Character string
Value 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.
Versions 20 and later
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst

Request run by HTTPSend Hide the details

HTTPCookieWrite(<HTTP request> , <Domain> , <Name> , <Value>)
<HTTP request>: httpRequest variable
Name of httpRequest variable for which the cookie will be set.
<Domain>: Character string
Validity 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
<Name>: Character string
Name of cookie.
This name is not case sensitive.
<Value>: Character string
Value 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.
New in version 20
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst

Request run by HTTPSend Hide the details

HTTPCookieWrite(<HTTP request> , <Domain> , <Name> , <Value>)
<HTTP request>: httpRequest variable
Name of httpRequest variable for which the cookie will be set.
<Domain>: Character string
Validity 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
<Name>: Character string
Name of cookie.
This name is not case sensitive.
<Value>: Character string
Value 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.
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst

Request run by HTTPSend Hide the details

HTTPCookieWrite(<HTTP request> , <Domain> , <Name> , <Value>)
<HTTP request>: httpRequest variable
Name of httpRequest variable for which the cookie will be set.
<Domain>: Character string
Validity 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
<Name>: Character string
Name of cookie.
This name is not case sensitive.
<Value>: Character string
Value 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
  • If the management of cookies was not enabled by HTTPCookieManage, the cookies are not sent to the server:
  • The cookie is created if it does not exist.
Component: wd270com.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment