会话无法在Ajax调用的通用处理程序上工作? [英] Sessions not working on generic handler called from ajax?

查看:84
本文介绍了会话无法在Ajax调用的通用处理程序上工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在从ajax调用通用处理程序.通用处理程序应该根据从我的数据库中检索到的ID创建会话.目前,我正在授予它对具有IRequiresSessionState的会话的完全读取和写入权限.

问题是第二次再次调用(使用相同的ajax方法)会话似乎为空.我尝试使用:IE,FF和chrome.奇怪的是,如果我从另一个窗口通过在地址栏中键入URL来调用通用处理程序,则可以看到它第二次在会话中写入ID存储区(就像本来那样).

因此问题似乎是从Default.aspx页面中的ajax方法调用的.我尝试将该页面设置为只读,以查看其是否有效,但是该尝试失败.尝试使用Cookie,但获得了相同的结果(因为会话使用了Cookie,所以达到了预期的效果).

有任何建议吗?

So I''m making a called to a generic handler from ajax. The generic handler is supposed to create a session from an ID retrieve from my database. Currently I''m giving it full read and write permission to sessions with IRequiresSessionState.

The problem is the second time is called again (using the same ajax method) the session appears to be null. I have try with: IE, FF and chrome. The weird part is that if I called the generic handler from another window by typing the URL in the address bar I can see it write the id store in the session the second time its called (Just like it was meant to do).

So the problem seems to be calling it from the ajax method in my Default.aspx page. I try setting that page to read-only to see if it works, but that attempt failed. Try using cookies but got the same results (as expected because sessions use cookies).

Any suggestions?

推荐答案

http: //stackoverflow.com/questions/4889437/asp-net-generic-handlers-session [

这篇关于会话无法在Ajax调用的通用处理程序上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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