使用Cookie存储在ASP MVC会议 [英] Using cookies to store session in ASP MVC
问题描述
存储在cookie中的整个会话已经标准的Rails在过去的几年里 - 有一种简单的方法来实现与ASP MVC
Storing the entire session in a cookie has been standard in Rails for the last few years - is there an easy way to achieve something similar with ASP MVC?
在默认情况下,在会话/ TempData的任何存储在内存中的服务器上。在web.config中这是可以改变一个SQL存储/服务器端缓存。我希望能有这些对象在cookie中保留。
By default, anything in Session / TempData is stored in memory on the server. In web.config this can be changed to an SQL Store / server-side cache. I'd like to be able to have these objects persisted in a cookie.
它看起来像我可以实现自定义会话状态存储提供。有没有更简单的方法呢?
It looks like I could implement a custom Session-State Store Provider. Is there a simpler approach?
推荐答案
是的,实行的自定义状态会话提供商。不,据我所知还没有一个简单的方法。
yes, implement a custom state session-provider. And no, afaik there isn't a simpler approach.
诗。它不是那么糟糕,因为它看起来即>的 ODBC示例半>被写入到数据库。
Ps. it isn't as bad as it looks i.e. > half of the odbc sample is writing to the db.
这篇关于使用Cookie存储在ASP MVC会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!