简体   繁体   English

当用户从当前页面导航时,从会话中删除数据

[英]remove data from session when user navigates from current page

Please help me with following problem. 请帮助我解决以下问题。

I am implementing credit card functionality and I want to remove data from session when user navigates from current page to other page. 我正在实现信用卡功能,并且当用户从当前页面导航到其他页面时,我想从会话中删除数据。

使用Session.Clear()从会话状态集合中删除所有值。

I guess you want to remove session data. 我猜您想删除会话数据。 May be you can read this reference document and Session.Contents.RemoveAll for more understanding. 可能您可以阅读此参考文档Session.Contents.RemoveAll以了解更多信息。 Also, you can use Session.Clear() to remove session variables from session state colelction 另外,您可以使用Session.Clear()从会话状态集合中删除会话变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当用户导航离开页面或退出浏览器时,如何在ASP.net中销毁会话 - How to destroy session in ASP.net when user navigates away from the page or exits the browser 在应用程序启动或导航到主页时在URL中设置当前文化 - Set Current culture in url when application starts or navigates to home page 离开页面时,从Razor视图中的会话中删除项目 - Remove item from session in Razor view when leaving the page 当用户离开页面时,如何将会话中的变量设置为null - How set null a variable from session when the user leaves a page 当用户仍然登录时,浏览器后退按钮导航到登录页面 - Browser back button navigates to login page when user is still logged in 使用导航离开页面时如何清理 Blazor Server 应用程序中的内存 - How to clean up memory in Blazor Server app when using navigates away from a page 从导航堆栈和WebBrowserTask中删除当前页面 - Remove the current page from the navigation stack and WebBrowserTask 从其他用户会话获取当前登录的用户 - Getting the Current Logged On User from a different User Session 从登录页面保存会话中的用户名 - save the user name in session from the login page 使用HttpContext从类库中删除当前会话 - Remove current session from Class Library using HttpContext
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM