xmlHttpRequest abort() method does not close the connection in Internet Explorer

纵然是瞬间 提交于 2019-12-01 19:16:28

I've almost never gotten abort to work in IE. I'm tired and can't remember why - something about not being able to abort until you're in readyState 4 (or maybe that it changed to readyState 4 when it aborts?). Either way, Ajaxian has a work around in the depths of its' archives:

http://ajaxian.com/archives/reusing-xmlhttprequest-without-abort

Parallel-Ajax requests vs Apache-Session locking


Session data is usually stored after your script terminated, but as session data is locked to prevent concurrent writes only one script may operate on a session at any time.

When e.g. using framesets together with sessions you will experience the frames loading one by one due to this locking. You can reduce the time needed to load all the frames by ending the session as soon as possible.


So you can use sessions in ajax scripts with session_start(); (maybe handled automatically) followed immediately (soon as possible) by session_write_close();

session_write_close(); will "end" the current session and store the session data.

But: session_id() will still deliver the correct (current) PHPSESSID so you're able to re obtain write access to the current session by simply doing session_start() again at any time you need it.


I use it this way in all my ajax scripts to implement session handling and allowing parallel request (with aborting) in all browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!