setCookie

setCookie ( string url , array[string] _data , string _referer , int _frequency_refresh , string _method ) : string

Set a cookie generated by a page. It use the GET method if no data and POST method else. Useful to simulate a login procedure. Returns the source code of the page.

Example


setCookie("https://www.site.com/post",[ 

'login':'contact@example.com' ,
'pword':'123456789',
'submit':'OK'
])


See also

setCookieValue
setCookieBody

Parameters

url

URL of the page, or the page of the form (ex: form for login)

_data (optional)

associative array of string with the content of the form

_referer (optional)

referer header. It is the origin page indicated.

_frequency_refresh (optional)

if you set 1000, this function is bypassed 999 times on 1000

_method (optional)

HTTP method (POST, GET, OPTIONS)