I have a web app that normally requires payment to use but the first session is a free trial.
document.addEventListener('DOMContentLoaded', function() {
if (trial === "true") {
window.location.replace("freeTrial.html?SD=" + userId);
}
});
If it's the first free trial session, the user is redirected to another page.
The problem is that on the second visit (when trial==="false"
), the browser (tested in Chrome) has cached the page from the first visit and the user is wrongly redirected.
How can I avoid this?