locked
How to show Warning when session was timed out RRS feed

  • Question

  • User-554652102 posted

    I developed an Asp.net MVC Web Application with Asp.net Identity Authentication. 

    How can I send a warning from server to client when session of user was timed out? (like facebook)

    What is the best method?

    I think that SignalR technology can help me. 

    Thanks.

    Tuesday, November 29, 2016 9:14 AM

All replies

  • User283571144 posted

    Hi shamekhi.ali,

    How can I send a warning from server to client when session of user was timed out? (like facebook)

    What is the best method?

    According to your description, I don't suggest you use SignalR to achieve your requirement.

    SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application.

    While chat is often used as an example, you can do a whole lot more.

    Any time a user refreshes a web page to see new data, or the page implements long polling to retrieve new data, it is a candidate for using SignalR.

    You could get the session timeout time in the controller, then you could store this value into viewbag.

    In the page, you could use javascript setTimout method to alert or popup a warning to show the session is expired.

    More details about how to achieve it, you could refer to follow link:

    http://stackoverflow.com/a/1740371

    Best Regards,

    Brando

    Wednesday, November 30, 2016 6:53 AM