社区
C#
帖子详情
在线急等,将sessionState中cookieless置为true中session丢失!
SuperBC
2003-11-18 04:14:47
问题描述:
在web.config中将sessionState中将cookieless置为true,此时如果执行js脚本,top.location.href="newURL"时,session中所有的变量值全部丢失。
请问各位大虾有什么可能造成这种现象,或者给一个解决的思路。
我先谢了先。
...全文
238
7
打赏
收藏
在线急等,将sessionState中cookieless置为true中session丢失!
问题描述: 在web.config中将sessionState中将cookieless置为true,此时如果执行js脚本,top.location.href="newURL"时,session中所有的变量值全部丢失。 请问各位大虾有什么可能造成这种现象,或者给一个解决的思路。 我先谢了先。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用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浏览器的相关配置有关?
再一次谢谢各位大虾。
asp.net
session
丢失
的解决方法小结
现在我就把原因和解决办法写出来。 ASP.NET
Session
丢失
原因: 由于Asp.net程序是默认配
置
,所以Web.Config文件
中
关于
Session
的设定如下: <
session
State
mode=’InProc’
state
ConnectionString=’tcpip sqlConnectionString=’data source=127.0.0.1;Trusted_Connection
cookie
less=’
true
’ timeout=’60’/> 我们会发现
session
State
标签
中
有个属性mode,它可以有3种取值:I
C#
SESSION
丢失
问题的解决办法
我们在用C#开发程序的时候经常会遇到
Session
很不稳定,老是数据
丢失
。下面就是
Session
数据
丢失
的解决办法希望对您有好处。 1、在WEB.CONFIG文件
中
修改
SESSION
状态保存模式,如:<
session
State
mode=’
State
Server’
state
ConnectionString=’tcpip sqlConnectionString=’data source=127.0.0.1;Trusted_Connection
cookie
less=’
true
’ timeout=’180’/> 2、启动系统服务“ASP.NET状态服务
asp.net配
置
会话状态
Session
实现代码
下面来详细说明: 代码如下: <
session
State
timeout=”timeout in minutes”
cookie
less=”[
true
|false]” mode=”Off|InProc|
State
Server|SQLServer”
state
ConnectionString=”tcpip=server:port”
state
NetworkTimeout=”for network operations with
State
Server,in seconds” sqlConnectionString=”valid SqlConnection string,minus Initi
关于有些Asp.net项目发布后出现网址乱码的解决方法
当我输入网站域名,打开网页后url
中
会跟一段“乱码” 代码如下:http://www.XXXX.com/(S(jnzpixfqi5rge5rnl45vdb45))/index.aspx 最后在查看web.config时看到了一句 <
session
State
mode=”InProc”
state
ConnectionString=”tcpip sqlConnectionString=”data source=127.0.0.1;Trusted_Connection
cookie
less=”
true
” timeout=”20″/> 想了一下,cooki
session
State
配
置
方案之
cookie
less
ASP.NET
中
客户端
Session
状态的存储 在我们上面的
Session
模型简介
中
,大家可以发现
Session
状态应该存储在两个地方,分别是客户端和服务器端。客户端只负责保存相应网站的
Session
ID,而其他的
Session
信息则保存在服务器端。在ASP
中
,客户端的
Session
ID实际是以
Cookie
的形式存储的。如果用户在浏览器的设
置
中
选择了禁用
Cookie
,那末他也就无法享受Sessi
C#
110,500
社区成员
642,577
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章