I have a modx revo 2.2.10 clean installation, and I'm developing a multilingual website using one context per language
I added some custom context settings to "web" context:
base_url -> /it/
site_url -> /it/
...
At some point I realized that $modx->getOption('base_url') returns '/' (wrong) if I'm logged into the manager, and returns '/it/' (right) if I'm not logged in.
I always advise clients to either use 2 different browsers (one for CMS management, other for front-view) or two tabs and do the CMS at the http://example.com/manager and the front-viewing at http://www.example.com
When you are logged into the manager your session is a mix of the 'web' context and the 'mgr' context.
Out of curiosity: How are your absolute URL's ending up? I always thought that the site_url setting was used for the basic "http://www.example.com/" part. Are absolute URL's ending up as '/it//it/' or not?
When you're logged into the Manager, and not previewing the front end, that getOption() call will get the base_url System Setting (if there is one) unless there is a base_url Context Setting for the 'mgr' context. If there's no base_url System Setting and no 'mgr' Context Setting, it will use the url the user came in on. All of these will be overridden by a base_url User Setting, though that's rarely used.
The process uses the settings in this order, stopping with the first success:
base_url User Setting
base_url Context Setting for current context
base_url System Setting
url the user came in on
The same process is followed for site_url. All other settings, AFAIK, use just the first three steps.