When using staging/live in setup where both live and staging databases are running in same Apache process the cache can get confused if sitegroup has different IDs in live and staging database.
You get something like:
midgard-core (pid:22548):(debug):query=SELECT id,password FROM person WHERE username='diasadmin' AND sitegroup=17 AND person.metadata_deleted=0
midgard-core (pid:22548):(info):Authentication type: NORMAL
...
midgard-core (pid:22548):(info):Setting sitegroup 'dias' (id: 11)
See how the SG changes from 17 (the one in current DB being used) to 11 (the other database).