How to prevent a user from having multiple instances of the Same Web application

前端 未结 16 618
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 05:39

I\'m wondering if it is possible to determine if a user already has a web browser open to the web application I\'m working on. It seems that they can open several instances

16条回答
  •  情深已故
    2020-12-06 06:10

    I would suggest you hash the ViewState for the page and store it in a session variable before it is returned as the Response.

    Then for a Request first check the hash of the returned ViewState against the one you have in the session variable and if they don't match don't process any changes on the page and display a notice to your user or redirect them to an error page.

    The two methods of the Page class you will want to override are;

    protected override object LoadPageStateFromPersistenceMedium()
    
    protected override void SavePageStateToPersistenceMedium(object viewState)
    

提交回复
热议问题