C语言写的CGI,有如下语句
printf("Set-Cookie:username = %s; path=/\r\n", username);
设置一个可以成功,在前端可以读出来。
但是如果要设置两个值,我试了以下方法:
printf("Set-Cookie:username = %s; password = %s; path=/\r\n", username, password);
或者
printf("Set-Cookie:username = %s; path=/\r\n", username);
printf("Set-Cookie:password = %s; path=/\r\n", password);
这两种方法都不行,那该如何设置呢
已解决,Set-Cookie后面添加上expires就可以了,但是没找到原因,必须要带expires?