在浏览器上,不执行PHP代码

On browser back php code is not executed in login. Steps there 2 webpage lets call x and y user can login from any of page either x or y 1.currently user is on x page 2.user navigate to y page and do login 3.user click on browser back button and came to x page 4.on x page it does not show login. 5.once i refreshed x page it start showing login

why this happens i am storing login values in session.

thank u

The back() method loads the previous URL in the history list. This is the same as clicking the "Back button" in your browser, or history.

Just refresh the page by going directly to index.php