Autologin without user and password

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, ‘/’, ‘yourdomain.com’, true, true);
‘Token’ is properly for mattermost? or which is the ‘text’?
Thanks again