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

后端 未结 2 1436
一整个雨季
一整个雨季 2021-01-18 22:48

I have multiple xmlHttpRequest on my page, and I am attempting to call the abort() method on them all. Works great in FF. IE, on the other hand doe

2条回答
  •  春和景丽
    2021-01-18 23:06

    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

提交回复
热议问题