以编程方式启用/禁用ASP.Net会话cookie [英] Enable / disable ASP.Net session cookie programmably

查看:200
本文介绍了以编程方式启用/禁用ASP.Net会话cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有全局删除asp.net_sessionId的解决方案-但是我想以编程方式添加它.它与欺骗用户无关,但是如果我对新的欧盟指令生效的理解,我必须给用户一个选择,接受或拒绝所有cookie..

借助Google Analytics(分析)轻松实现-如果用户说是"或否",请注册脚本.而且我知道如何全局禁用ASP.Net_sessionId,但是如果用户说确定",我想将其重新打开!

I have solutions for globally removing the asp.net_sessionId - but I then want to add it programmably. Its nothing to do with tricking the user, but if my understanding of the new EU directive coming into action, I must give users an option to accept or reject ALL cookies..

Easy with Google Analytics - register the script IF the user says OK, or don''t. And I know how to disable ASP.Net_sessionId globally, but if the user says OK, I''d like to turn it back on!

Ideas?

推荐答案

您也可以在页面级别启用或禁用会话.使用页面 [如何在ASP.NET中禁用ASP会话状态 [
You can enable or disable session at page level too. Using Page[^] property EnableSessionState.

Have a look at this article: How To Disable ASP Session State in ASP.NET[^]


这篇关于以编程方式启用/禁用ASP.Net会话cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆