在线急等,将sessionState中cookieless置为true中session丢失!

SuperBC 2003-11-18 04:14:47
问题描述:
在web.config中将sessionState中将cookieless置为true,此时如果执行js脚本,top.location.href="newURL"时,session中所有的变量值全部丢失。
请问各位大虾有什么可能造成这种现象,或者给一个解决的思路。
我先谢了先。
...全文
238 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
SuperBC 2003-11-21
  • 打赏
  • 举报
回复
先谢谢思归大哥!
当cookieless=true时,我用Session.SessionID的方式已经测试成功。
saucer 2003-11-20
  • 打赏
  • 举报
回复
>>> 如果页面采用windows.open()呢?cookieless=true怎样处理呢?

you need to use relative path and better pass along the cookie part in the url

>>>有的客户端执行操作一段时间以后,windows.open页面会丢失session中的值

that is because the session timed out, consider to use a large session timeout

sometimes a session could also be lost when you open a "_blank" window

>>是否和session中存放的数据的多少有关,

shouldn't be, as long as your web server has enough resources and your web application is not recycled or reloaded

>>或者IE浏览器的相关配置有关?

yes, if you disable cookies and you are not using cookieless=true
saucer 2003-11-19
  • 打赏
  • 举报
回复
if you set cookieless=true, the session id will be in the url, if you want to use javascript to set a new location, you'd better to parse the current url, extract the session id and pass it back in your new url
SuperBC 2003-11-19
  • 打赏
  • 举报
回复
up!
SuperBC 2003-11-19
  • 打赏
  • 举报
回复
up!
ruanyuping 2003-11-19
  • 打赏
  • 举报
回复
SuperBC 2003-11-19
  • 打赏
  • 举报
回复
如果页面采用windows.open()呢?cookieless=true怎样处理呢?
还有如果我用cookieless=false,inproc模式,有的客户端浏览器执行windows.open正常处理,有的客户端执行操作一段时间以后,windows.open页面会丢失session中的值,有什么可能造成这种现象?是否和session中存放的数据的多少有关,或者IE浏览器的相关配置有关?
再一次谢谢各位大虾。

110,500

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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