There is a security problem in the JUser model. Please update as soon as possible.
https://www.joomla.org/announcements/release-news/5693-joomla-3-6-5-released.html

Joomla 2.5.x is not anylonger supported by the Joomla project, but we know that a lot people still use joomla 2.5. with VirtueMart. As promised, we provide a fix http://dev.virtuemart.net/attachments/download/1036/Joomla2.5.28-20161214PATCH.zip (Direct link).

This patch is just the one for j2.5.28 of last year extended by the new files. Update your joomal 2.5.x at least to the last version j2.5.28.

It is normal that an unpatched j2.5.28 logs you out. The patch should be still applied.