asp.net 2.0重写SessionID生成器
点击次数:60 次 发布日期:2008-11-06 08:12:09 作者:源代码网
|
源代码网推荐
源代码网整理以下asp.net 2.0下可以重写SessionID的生成规则 下面的例子是个Disable SessionID生成的实现类,也可以改成成自己的实现类
配置:
sessionIDManagerType="IndustryStrengthSessionState. SessionDisablementIDManager"/>
源代码网整理以下
源代码网整理以下
源代码网整理以下public class SessionDisablementIDManager : SessionIDManager { // override the ID management behavior of the session ID manager public override String GetSessionID(HttpContext context) { // do not return the session ID if no session state is // desired for this request if (ShouldSkipSessionState(context)) return null; // otherwise just delegate to the built-in session // ID manager to get the session ID from the request else return base.GetSessionID(context); } protected virtual bool ShouldSkipSessionState(HttpContext context) { // determine if session state should be skipped for this request } } 源代码网推荐
源代码网供稿. |