We help IT Professionals succeed at work.

Asp.net Ajax polling chat : keep session on website update

noulouk asked
Hi Experts,

My website has a chat section which polls every 2 seconds to refresh the messages.
My users are logged in to access a particular chat and all works fine.

When I update my website (ie my webapplication), I don't want my chatters to be disconnected because of this update.
How can I make the update transparent for my users.

Thanks in advance for your help.
Watch Question

i assume you are using session and that is the reason why your user gets disconnected when you update the site .. i also assume when you say update the site, you mean update some page which is not part of the chat session .. anyway, to handle this situation, you will have to write your own custom session handling which might not be worth the effort .. so make changes when there are no users logged in ..



Thanks Rejo,

You mean to store session in SQL Server for example instead of Application memory.
OK, I can do this easily.
But the problem is that the chat section is a part of my whole website (unique webapplication) and not a stand alone webapplication included in my website.
And another big problem is that I don't want to close all chat sessions and unlog all users to make an update.

I think there is a way to update a website when users are logged in and to make it transparent for them.
you can  update parts of the page if you have deployed your website as multiple assemblies and not a single assembly .. so whenever you have a change in your code that is not part of the chat screens, you just have to copy the respective dlls to the bin folder ..

i did not mean SQL server, because again outproc sessions also abandones session whenever the application restarts .. normally the application restarts when the web.config file is re-written or IIS restarts etc ..


Explore More ContentExplore courses, solutions, and other research materials related to this topic.