`

转session_write_close

    博客分类:
  • php
 
阅读更多

转:

遇一问题:

一个页面中有若干个ajax请求,当其中某个ajax请求卡住的时候,点击页面其他链接,页面不能立即跳转,会一直等待ajax的响应。

 

解决办法:

在该ajax请求的资源中,添加session_write_close (该资源业务处理中,没有对session的写操作,如果有写操作的话,其他页面从session是取不出来的)。

 

Description

void session_write_close ( void )

End the current session and store session data.

Session data is usually stored after your script terminated without the need to call session_write_close(), but as session data is locked to prevent concurrent writes only one script may operate on a session at any time. When 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 all changes to session variables are done.

分享到:
评论

相关推荐

    php提示Failed to write session data错误的解决方法

    提示信息:Warning: Failed to write session data (files).Please verify that the current setting of session.save_path is correct () in Unknown on line 0 二、解决方法: 代码如下:复制代码 代码如下:session...

    处理session跨域几种方案

    function write($sessID, $sessData) { // new session-expire-time $newExp = time() + $this->lifeTime; // is a session with this id in the database? $res = @mysql_query("SELECT * FROM ".self::...

    PHP 解决session死锁的方法

    今天在开发碰到个棘手的问题 。当异步请求后台处理一个大数据量操作时 请求其他控制器都没返回信息了。。起初以为是Ext 框架设置了ajax同步造成的...代码如下:Descriptionvoid session_write_close ( void )End the cu

    通过HttpURLConnection获取SESSIONID

    out.write(parameters.getBytes(),0,parameters.getBytes().length); InputStream in = hc.getInputStream(); InputStreamReader reader = new InputStreamReader(in,"gb2312"); BufferedReader read = ...

    PHP自定义session存储(mysql数据库)

    里边有详细代码,包含SQL脚本,有需要可以参考 //设置用户自定义Session存储 session_set_save_handler('... 'mysession_close', 'mysession_read', 'mysession_write', 'mysession_destroy', 'mysession_gc'); ?>

    PHP中Session引起的脚本阻塞问题解决办法

    解决session阻塞问题的办法:在session操作完成后调用session_write_close()即可避免此问题; 案例一: 使用session过程中,在开启session后,同一浏览器,执行同一程序,不同页面会被锁。不同浏览器不会出现这种情况...

    PHP session文件独占锁引起阻塞问题解决方法

    PHP默认的会话处理器是session.save_handler = files(即文件)。...(1)修改会话变量后,立即使用session_write_close()来保存会话数据并释放文件锁。 session_start(); $_SESSION['test'] = 'test'; sessi

    实现在同一方法中获取当前方法中新赋值的session值解决方法

    PHP SESSION有一个函数:session_write_close(),这个函数的作用是:写入session数据保存并且结束session。 手册中对该函数的描述中说到:Session data is usually stored after your script terminated without the

    易语言代理服务

    易语言代理服务源码,代理服务,idle,close,stop,init,GetPeerHandle,GetClientHandle,on_peer_start,on_peer_read,on_peer_write,on_close,on_peer_close,on_client_connect,on_client_read,on_client_write,on_...

    PHP使用Redis替代文件存储Session的方法

    本文实例讲述了PHP使用Redis替代文件存储Session的方法。分享给大家供大家参考,具体如下: PHP默认使用文件存储session...bool session_set_save_hanler(callback open,callback close,callback read,callback write,c

    Redisent-PHP-Session-Handler:这是PHP的会话处理程序,使用Redisent库提供了惊人的Redis键值存储库(http

    [未维护] ...AF83(2011)版权所有,PC贡献 ... 您最好使用因此,如果可以使用编译后的扩展名,那... 注意:由于PHP的可怕原因,我们必须手动调用session_write_close,因此您将在每次执行脚本时写入会话。 会话数据是否更改

    ios 录音文件caf转mp3

    ios录音的caf文件转MP3文件,以兼容android 注意音频参数的设置,如果声音异常,请调整参数。 code: AVAudioSession *session = [AVAudioSession sharedInstance]; NSError *sessionError; [session ...

    php自定义session示例分享

    phpclass session{ static function init() { session_set_save_handler( array(“session”,”open”), array(“session”,”close”), array(“session”,”read”), array(“session”,”write”), array...

    session在PHP大型web应用中的使用

    这时,函数bool session_set_save_handler ( callback open, callback close, callback read, callback write, callback destroy, callback gc )就是提供给我们解决这个问题的方案. 该函数使用的6个函数如下: 1. bool...

    Linux-FTP配置说明及安装源文件

    20.1 ftp服务 ftp采用客户/服务器工作模式,这里采用的是vsftpd ftp服务器软件。ftp工作方式分为两种,一种port主动模式,一种pasv被动模式,是服务主动与被动进行连接。一般ftp服务器都为被动...write_enable=yes /...

    LINUX FTP设置方法

    close 终止当前的ftp会话 hash 每次传输完数据缓冲区中的数据后就显示一个#号 get(mget) 从远程机传送指定文件到本地机 put(mput) 从本地机传送指定文件到远程机 open 连接远程ftp站点 quit 断开与远程机的连接...

    libusb-1.0.9

    //close the session return 0; } void printdev(libusb_device *dev) { libusb_device_descriptor desc; int r = libusb_get_device_descriptor(dev, &desc;); if (r ) { cout; return; } cout(int)...

    网上商城毕业设计asp 文档

    response.Write "<script LANGUAGE='javascript'>alert('登录失败!请检查您的登录名和密码!');history.go(-1);</script>" conn.Close set conn=nothing response.end end if if not isnumeric(request.form...

    DotNetFtpSources

    if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Last modification : 04/20/2004 by Simon FERQUEL */ using System; using System.IO; using ...

Global site tag (gtag.js) - Google Analytics