简体   繁体   中英

how to use cookie in telegram Bot Api with php?

I tried use cookie in php file of telegram webhook, but don't work!
My code is:

$cookie_name = "tlgrm_command";
$cookie_value = "code";
setcookie($cookie_name, $cookie_value, time() + (86400*2), "/"); // 86400 = 1 day

But $_COOKIE[$cookie_name] is null !

The best way is to: Use a session. It has higher security and your problems will be solved this way

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM