the problem is that the redirect is not working, it should ignore a search page after login, but it is not. the user clicks on a button to reserve his book, if he is not logged in, a prompt box will ask him for the login information, after login, the user should be redirected to a request form. and now it is taking him to the search page that is defined in the action of the login form.
var cookieName = "activeRequest";
var variableName = "requestUrl";
var lifetime = 60;
$(document).ready(function() {
"use strict";
//$.Jookie.Initialise(cookieName,lifetime);
$(".public_request").click(function() {
//alert("click");
var url = $(this).attr("id");
store(url);
//alert(url);
//return false;
});
});
//store the request link
function store(url) {
"use strict";
$.Jookie.Initialise(cookieName, lifetime);
$.Jookie.Set(cookieName, variableName, url);
}
//check for a active request
function checkForRequest() {
"use strict";
$.Jookie.Initialise(cookieName, lifetime);
var reqURL = $.Jookie.Get(cookieName, variableName);
//check the response and see if there was one
if (reqURL === undefined) {
return false;
}
else {
deleteCookie();
redirect(reqURL);
}
}
//redirect to request
function redirect(url) {
"use strict";
window.location = url;
}
//delete an active request after redirect
function deleteCookie() {
"use strict";
$.Jookie.Initialise(cookieName, lifetime);
$.Jookie.Unset(cookieName, variableName);
}
should be