My home page is a php page who actually check if user is logged in.
If ok, then 'include' the html page with the main web-application
If no, then 'include' the html page for login.
And this works well.
I just finished to create registration form and login form. All works fine, but... after a correct login, i'd like to redirect the page, or at least to reload. So the php can verify it's logged in correctly and then include the main app.
How to 'reload' the page ? (and how to 'redirect' the browser?)
I use a very conventional, "HTML-ish" way of doing this in my Ajax applications. The main application page checks for login and, if not logged in, redirects to a separate login page by way of an HTML "location:" tag. As PHP can do whether the page is Ajax or not. Once login is complete, I redirect again to the main application page.
Obviously, there is always the issue of "where am I?" when dealing with Ajax-y things. The URL ("where am I") might not change at all if you don't want it to, and indeed some apps do things in just that way: they "include" different things in a main application-window framework. (This seems to be the design that you are alluding to.) But others don't, e.g. the forum software of this very web-site. I do not think that any choice is "de facto superior." Others may disagree... let's see if they chime in.