So, the site already works for me (I do not work from scratch). The problem is that most of the content is only available if you are logged in (almost all). So sometimes I have a modal popup that retrieves (using ajax) something displayed.
In my server code, if someone is not logged in, they are redirected to the login page.
This creates a strange effect, as if someone is on the page and is no longer logged in, and then the modal that appears tries to display the page on the page.
What are the possibilities for straightening?
The only thing I can think of is to have a URL that checks if they are logged in and returns this, and with each ajax request, I could check if they were logged in or not, and Javascript could act accordingly.
I hope for other possibilities.
source
share