How to Kill A Session or Session ID (ASP.NET/C#)

前端 未结 9 1308
礼貌的吻别
礼貌的吻别 2020-11-30 04:09

How can I destroy a session (Session[\"Name\"]) when the user clicks the logout button?

I\'m looking through the ASP.NET API Reference on MSDN and it doesn\'t seem t

9条回答
  •  死守一世寂寞
    2020-11-30 04:34

    Session.Abandon() this will destroy the data.

    Note, this won't necessarily truly remove the session token from a user, and that same session token at a later point might get picked up and created as a new session with the same id because it's deemed to be fair game to be used.

提交回复
热议问题