首页 > 代码库 > PHP jquery session超时处理

PHP jquery session超时处理

php:

<?phpheader(‘sessionStatus:timeOut‘);//is_ajaxecho $_SERVER[‘HTTP_X_REQUESTED_WITH‘];

 




html:
<!
doctype html><html lang="en"> <head> <meta charset="utf-8"> <script type="text/javascript" src="js_class/html5/jquery-1.7.2.js"></script> <script type="text/javascript"> $(function(){ $.ajax({ url:file_exits.php, type:"get", success:function(res){ alert(res); }, complete:function(XMLHttpRequest, str){ if(XMLHttpRequest.getResponseHeader("sessionStatus") == "timeOut"){ alert(超时了); } }, }); }); </script> </head> <body> </body></html>