MVC根据querystring在入口点添加cookie
得到了 cookie 跨站点可用性的场景(桌面站点和移动站点之间)。当有人以“http://www.xyz.com?qrystring=12345”或“http://m.xyz.com?qrystring=12345”身份进入时,我必须为域 (.xyz.com) 添加一个 cookie。在 Asp.Net 桌面应用程序中实现它,但想在 Asp.Net MVC2 移动站点中实现类似的事情。
有关如何从 MVC 移动网站的任何页面捕获该信息的任何建议。它可以是移动网站 (m.xyz.com/page1?qrystring=1234) 上的任何页面,我应该能够从中添加 cookie。 使用 ASP.NET MVC2 且无法使用 MVC3
在这种情况下,使用 global.asax 中的 Application_BeginRequest 事件对于 MVC 应用程序是否安全?
Got a scenario of cross-site availability of cookies (between desktop site and mobile site). When someone comes in as "http://www.xyz.com?qrystring=12345" OR "http://m.xyz.com?qrystring=12345", I have to add a cookie for the domain (.xyz.com). Implemented it in the Asp.Net desktop app, but want to implement similar thing in Asp.Net MVC2 mobile site.
Any suggestions as to how to capture that from any page of the MVC mobile site. It can be any page on mobile site (m.xyz.com/page1?qrystring=1234) from which I should be able to add cookie. USING ASP.NET MVC2 and CAN'T USE MVC3
Can using Application_BeginRequest event in global.asax be safe with MVC app in this scenario?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以编写一个 actionrilter 属性并用它装饰您的控制器,
然后您可以用该属性装饰您的控制器,例如
当然您必须根据您的要求更改属性的实现。
you can write an actionrilter attribute and decorate your controller with it like
then you can decorate your controller with the attribute like
Of course you will have to change implementation of the attribute according to your requirements.