PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Limits
  • Various
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
Writes a cookie onto the computer of the Web user.
WEBDEV - Server code The cookie is written during the next display of a WEBDEV page in the browser.
WEBDEV - Browser code The cookie is written onto the computer of the Web user.
WEBDEV - Server codePHPAjax
// -- Click on a BTN_Validate button (server code)
// Create a cookie: save the user name
// and the date of last visit
CookieWrite("NAME_AND_DATE", Name + "," + DateSys())
PageDisplay(PAGE_Purchases)
WEBDEV - Browser codePHP
// -- Click on a BTN_Save button (browser code)
// Create a cookie: save the search options
CookieWrite("SEARCHOPT", Keyword + "," + ByIDENTICAL)
Syntax
CookieWrite(<Cookie Name> , <Cookie Value> [, <Validity Period> [, <Path> [, <Domain> [, <Type of Cookie>]]]])
<Cookie Name>: Character string with quotes
Name of the cookie that must be written onto the computer of the Web user. This name can be used during the call to CookieRead.
Caution: The ";" character cannot be used in the name of the cookie.
<Cookie Value>: Character string with quotes
Value of the cookie to write onto the computer of the Web user. This value can be a list of data, various information, ... The maximum size of the character string cannot exceed 4000 characters.
Caution: The ";" character and the "Carriage Return" (CR) character cannot be used in the value of the cookie.
<Validity Period>: Optional integer
Number of days during which the cookie is valid. Once this number of days is exceeded, the cookie is automatically deleted from the computer of the Web user. The cookie is valid for 30 days by default.
<Path>: Optional character string (with quotes)
Versions 20 and later
Path for which the cookie must be saved. This path must exist on the server. This parameter is case sensitive.
By default (or if this parameter corresponds to an empty string), the path corresponds to "/".
Example: "/COOKIES_WEB/FR/LOGIN"
New in version 20
Path for which the cookie must be saved. This path must exist on the server. This parameter is case sensitive.
By default (or if this parameter corresponds to an empty string), the path corresponds to "/".
Example: "/COOKIES_WEB/FR/LOGIN"
Path for which the cookie must be saved. This path must exist on the server. This parameter is case sensitive.
By default (or if this parameter corresponds to an empty string), the path corresponds to "/".
Example: "/COOKIES_WEB/FR/LOGIN"
<Domain>: Optional character string (with quotes)
Versions 20 and later
Domain for which the cookie must be saved.
  • If this parameter is not specified or if it corresponds to an empty string, the domain corresponds to the current domain. The cookie will be associated with this domain only.
  • If this parameter explicitly corresponds to a domain name, the cookie will be associated with the specified domain name and with all its sub-domains.
New in version 20
Domain for which the cookie must be saved.
  • If this parameter is not specified or if it corresponds to an empty string, the domain corresponds to the current domain. The cookie will be associated with this domain only.
  • If this parameter explicitly corresponds to a domain name, the cookie will be associated with the specified domain name and with all its sub-domains.
Domain for which the cookie must be saved.
  • If this parameter is not specified or if it corresponds to an empty string, the domain corresponds to the current domain. The cookie will be associated with this domain only.
  • If this parameter explicitly corresponds to a domain name, the cookie will be associated with the specified domain name and with all its sub-domains.
<Type of Cookie>: Optional Integer constant
Versions 21 and later
Type of cookie to write:
cookieHTTPOnlyCookie that can be retrieved in server code only. This cookie cannot be read in browser code.
WEBDEV - Browser code This constant is not available.
cookieNormal
(Default value)
Cookie without specific options.
This constant cannot be combined with the other constants.
cookieSecureCookie transmitted in an HTTPS request only.
New in version 21
Type of cookie to write:
cookieHTTPOnlyCookie that can be retrieved in server code only. This cookie cannot be read in browser code.
WEBDEV - Browser code This constant is not available.
cookieNormal
(Default value)
Cookie without specific options.
This constant cannot be combined with the other constants.
cookieSecureCookie transmitted in an HTTPS request only.
Type of cookie to write:
cookieHTTPOnlyCookie that can be retrieved in server code only. This cookie cannot be read in browser code.
WEBDEV - Browser code This constant is not available.
cookieNormal
(Default value)
Cookie without specific options.
This constant cannot be combined with the other constants.
cookieSecureCookie transmitted in an HTTPS request only.
Remarks

Limits

  • The maximum size of a cookie cannot exceed 4000 characters. Up to 20 cookies can be written per domain.
  • The cookies written in server code cannot be read in browser code.
    Caution: in AWP mode, the cookies written in server code can be read in browser code.
  • The cookies written in browser code cannot be read in server code.
    Caution: in AWP mode, the cookies written in browser code can be read in server code.
  • The maximum size of a cookie cannot exceed 4000 characters. Up to 20 cookies can be written per domain.
  • WEBDEV - Server code A single cookie can be written per page. The cookies written during the current session cannot be read.
    Reminder: When the Web user connects to a WEBDEV site, the Web server loads all the cookies associated with the current domain in memory.
    Note: The Internet domain corresponds to a specific section of the Internet address: http://computer.domain.com/MyPages/Index.html.

Various

  • Some browsers give you the ability to disable the cookies. In this case, CookieWrite has no effect.
  • If the name or the value of your cookie contains special characters (* for example), accented or UNICODE, the writing of the cookie may have no effect with some browsers.
Components
WEBDEV - Server code wd230page.dll
Linux wd230page.so
WEBDEV - Browser code WDJS.DLL
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment