Autologin without user and password

I have seen in several threads of this forum that you can login without password and user (for example [SOLVED] Login to Mattermost from browser by skipping the login form), with setcookies, but I have not seen a complete example of setcookies, and I can not know what text to put for $key.
So, for example, see a complete example using the following:
setcookie($key, $value, time()+606024*30, ‘/’, ‘’, true, true);

Hi @pacoeu!

Would this documentation help or let me know if it doesn’t help clarify things:

Thanks for your answer.
The problem is not the use of the function setcookie, but the values of $key. Could you put the required sentence for the token? For example:
setcookie(’'Token, ‘valuepostedapi’, time()+606024*30, ‘/’, ‘’, true, true);
‘Token’ is properly for mattermost? or which is the ‘text’?
Thanks again

@prixone Would you know what values are required for $key, $value in:

setcookie($key, $value, time()+60*60*24*30, '/', '', true, true);

exactly! I get the value of $value via API, but I don’t know what value to set for $key.
Any help please?