If my browser sends a xmlHttpRequest to the server, is there any fixed length of time that the server must deliver a response in? or is it indefinite?

I ask because I'm new to Ajax and I need to do some long polling w/ continuation on the server side.

Also, suppose the browser has sent an xmlHttpRequest to the server, which has not yet delivered a response. If I exit the page, will the request be immediately cancelled? Or will the server remain unaware?