LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 999|回复: 0

cgi cookie求助

[复制链接]
发表于 2008-4-3 14:20:13 | 显示全部楼层 |阅读模式
我刚刚开始接触这个,在设置cookie后,读取回来的都是NULL,为什么啊?我的平台是uclinux.程序如下: #include <stdlib.h>
#include <stdio.h>

int main(void)
{
char *p;

printf("Set-Cookie:sess_id=uuuuuu; expires=Fr,10-19-2009 00:00:00 GMT");
p=getenv("HTTP_COOKIE");
printf("Content-Type:text/html\n\n");
printf("cookie string: %s\n",p);
return 0;
}
网页如下:<html><head>
<title>Test Cookie</title>
</head>
<body>
<form METHOD=GET ACTION="/cgi-bin/test">
<INPUT TYPE="SUBMIT" VALUE="get cookie">
</form>
</body>
</html>
在浏览器上看到的结果就是
cookie stringnull)
各位帮帮忙啊~~~~谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表