ASP.NET MVC:使会话完全没有 cookie(隐藏表单字段) [英] ASP.NET MVC: Make Session entirely cookie-less (hidden form field)

查看:50
本文介绍了ASP.NET MVC:使会话完全没有 cookie(隐藏表单字段)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有某种标准化的方法可以让我的 ASP.NET MVC Web 应用程序会话完全减少 cookie,但仍然通过每个页面上的一些标准化隐藏表单字段值来保持会话支持(例如,每个请求都会透明地解析哪个)?

is there some kind of standardized way which would allow me to make my ASP.NET MVC web app sessions entirely cookieless, but still keep session support through some standardized hidden form field value on every page (e.g. which would get parsed transparently on every request)?

附言我不是在寻找基于 URL 的/(sessionid)/解决方案.如上所述,这最好是通过隐藏的表单字段.

P.S. I'm not looking for a URL based /(sessionid)/ solution. As stated above, this should preferably be via hidden form field.

推荐答案

只有当您网站上的每个导航元素都是提交表单的按钮时,隐藏的表单字段才有效.这会(除其他外)使后退按钮和刷新变得笨拙,并使您的网站无法被搜索引擎发现.

A hidden form field would only work if every navigation element on your site is a button which submits the form. This would (among other things) make the back button and refresh awkward and make your site un-spiderable to search engines.

这篇关于ASP.NET MVC:使会话完全没有 cookie(隐藏表单字段)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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