How can I share .net (C#) based authenticated session between web forms and MVC2 applications?

后端 未结 4 1211
借酒劲吻你
借酒劲吻你 2020-12-15 11:20

We have a small application we built in our spare time using the latest mvc3 and Entity Framework .net libraries available at the time, and deployed it. The management liked

4条回答
  •  被撕碎了的回忆
    2020-12-15 12:00

    Store the session state in a database. Store the session key in the cookies of each sessions. At the AcquireSessionState event in the life cycle's of both applications, get the session id from the cookie, load the session data from the database and update your HttpContext.User. You will then have the same authentication data in both applications.

提交回复
热议问题