session变量问题

xiaoplx 2006-08-22 02:36:17
我是index.asp里session变量付值,可以确定已经付了值
<%
session("userid")=trim(rs("xf_userid"))
session("username")=trim(rs("xf_username"))
response.Redirect "Main.asp"
%>

可到了Main.asp, session变量全为空了
<%
response.write session("username")
if session("userid")="" then
response.redirect "Index.htm"
end if
%>
...全文
248 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoplx 2006-08-22
  • 打赏
  • 举报
回复
response.Write "<script LANGUAGE='javascript'>alert('"&session("userid")&"');</script>"
response.end
在response.Redirect "Main.asp"前是有值的

但,加在main.asp最前面就没有值了~~
非凡笨笨 2006-08-22
  • 打赏
  • 举报
回复
在重定位前和后都加上alert试试
xuyiheng 2006-08-22
  • 打赏
  • 举报
回复
你alert()出来看看

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧