Explore what mosRedirect does in joomla documentation

| Code: |
mosRedirect($mosConfig_live_site.$_ENV["REQUEST_URI"]);
|
You will find out that in case code processing gets inside that if statement in which we replaced that settimeout...reload, then if will never get to 2nd UPDATE.
In fact, I think that settimeout...reload had value of 100ms in it just so that php processing will get to that 2nd UPDATE line and be executed and reload happens after that.
Because if UPDATE wont happen, your code gets into endles loop of reloading.
This was implemented:
| Code: |
IF (session does not exist or it expired) {
reload after 100ms
}
UPDATE session table and set last users visit time
|
Now IF we would change it to:
| Code: |
IF (session does not exist or it expired) {
reload right away (leave code) which mosRedirect() does this file execution will end here
}
UPDATE session table and set last users visit time
|
If we hit mosRedirect it will never get to UPDATE session table so same IF statement will fail on next execution = endless loop
that is why
| Code: |
IF (session does not exist or it expired) {
UPDATE session table and set last users visit time (copy of line outside IF)
mosRedirect(); //leave this code, and reload everything (but happens before anything is printed out to user, so there is no reload visible)
}
UPDATE session table and set last users visit time
|