|
Not using java script as I don't know enough of it, but this is how I got around a similar problem using PHP, perhaps you can use it with your javascript somehow?
At the top of each page, except the login page use:
$_SESSION[currentPage] = $PHP_SELF;
Which will store the current page url you're looking at in a global session variable
When referring back to that page, ie. redirecting put this code at the top of the page maybe your login page or, the page that checks login details:
$currentPage = $_SESSION[currentPage];
And then after login is approved you can direct them to the page stored in the $currentPage variable
|