CountCGICookies()

Syntax

Result = CountCGICookies()
Description
Returns the number of available cookies. The cookies are small persitent files stored in the web browser to allow to remember a context and ease future navigation when loading the same page later on. Please note than European legislation now impose to inform users that cookies are not being used to gather information unnecessarily.

Parameters

None.

Return value

Returns the number of available cookies. The name and value of cookies can be get with CGICookieName() and CGICookieValue().

Example

  If Not InitCGI() Or Not ReadCGI()
    End
  EndIf
  
  WriteCGIHeader(#PB_CGI_HeaderContentType, "text/html") ; Write the headers to inform the browser of the content format
  WriteCGIHeader(#PB_CGI_HeaderSetCookie  , "mycookie=hello", #PB_CGI_LastHeader) ; Write one cookie named 'mycookie'
  
  WriteCGIString("<html><title>PureBasic - cookies</title><body>" +
                 "NbCookies: " + CountCGICookies() + "<br><br>")

  WriteCGIString("</body></html>")

See Also

CGICookieName(), CGICookieValue()

Supported OS

All

<- CGIVariable() - CGI Index - CountCGIParameters() ->