I have trouble deleting the cookies at the end of the order process. For some strange reason the setcookie('chesed_sz','',$pastdate); command executes successfully (returns true), but the cookie continues to live in IE with the original expiration date.
To go away from a cookie solution i found a coded approach, using ajax, that supports via an "RPC" call, to set session variables.
Essentially, i would be creating an rpc.php file that would receive the ajax call and set the session. Something like below (the actual rpc code is from the internet, not adapted yet to my need): I am however wondering whether i am introducing a serious security risk here. What code should rpc.php additionally include, and where should it reside, to avoid opening any security holes?
thank you,
Dan
rpc.php
switch($_REQUEST['action']) {
case 'charity1':
/* do something */
$_SESSION[charity1]= $+POST[var];
break;
...
}
function createRequestObject() {
var ro;
ro = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
return ro;
}
var http = createRequestObject();
function sndReq(action) {
http.open('get', 'rpc.php?action='+action);
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse() {
if(http.readyState == 4){
var response = http.responseText;
var update = new Array();
if(response.indexOf('|') != -1) {
update = response.split('|');
document.getElementById(update[0]).innerHTML = update[1];
}