2 years ago
#42965
pesho hristov
Referrer persists when I refresh the page. Why isn't it clared?
On the website I'm working cart page and checkout page are part of a single page app.
And we have this scenario:
- User is on product page.
- Adds the product to cart - and then he/she lands on cart page.
- After that user proceeds to checkout page.
- And then, if we refresh the page - the document.referrer points to the product page. (The page before cart and checkout.)
And this is problematic, cause we have logic for that which shouldn't execute after the refresh.
I noticed that when we refresh the checkout page - the Referer
request header is set and I guess that's the problem. But why is it set? ... Shouldn't this Referrer
header get cleared after user navigates away from product page?
(This happens on Chrome and Safari, it doesn't happen on Firefox.)
EDIT:
I narrowed down the things to two simple pages:
- page1.html has only a button. When clicked on it - I make
location.href = 'page2.html'
. - page2.html - there I simply show the
document.referrer
.
So - when I go to page2.html - referrer is page2.html. But when I refresh page2.html - referrer is STILL page1.html.
Why is that? Shouldn't it be blank or page2.html ?
http
http-referer
request-headers
0 Answers
Your Answer