【发布时间】:2012-12-31 07:57:57
【问题描述】:
大家好,我正在创建一个 TOS 弹出窗口,如果用户拒绝 .ajax 函数,则会调用一个 .php 文件,该文件会破坏他们的会话并将其发送回登录页面。
这是一个受 SSL 锁保护的网站,所以我收到一条错误消息:
where the ajax function is that gets the other page with the destroy session and redirect 的页面显示来自the login page which is suppose to be sent to, the user. 的不安全内容
功能:
function decline(){
$("#dialog-container").dialog( 'close' );
/*****run ajax to kill session of current user and return to login page ******/
$.ajax({ url: 'termsofservice/declinedkill.php',
data: {},
type: 'get',
success: function(output) {
}
});
}
这里是被拒绝的kill.php:
session_start();
session_destroy();
header("location:/PCG/mainlogin.php");
我确定我没有使用任何包含其他文件等的链接。所以不确定是什么问题。
谢谢,大卫 :)
编辑:
这是我正在使用的更新链接:
$.ajax({ url: '//mysite.com/PCG/termsofservice/declinedkill.php',
data: {},
type: 'post',
success: function(output) {
}
});
declinedkill.php
header("location:https://mysite.com/PCG/mainlogin.php");
所以现在我没有收到该消息,但我没有被重定向?
【问题讨论】:
-
对不起....我会重新编辑的
-
不发送重定向怎么样?只需在成功处理程序中设置 window.location ?您可以让 AJAX 调用返回要关注的 URL
标签: java php javascript ajax ssl