I've tried two ways.
(1) User enters info->Ajax call to verify credentials->From server side send a header, capture it at the client and write it using document.write().
(2) User enter info->Ajax call to verify credentials->Server side completes ->Back on client side call the new page using window.location.href.
"One" partly works except it feels like a hack and also the onload function is not called(so this part is broken) when I used document.write() to send the whole page.
"Two" works except it is inefficient, when I finish verifying credentials, at the server, wrather then sending the correct page immediately, control is passed back to the client(javascript) which then requests the page back from the server, i.e. two round trips.