Thats not a glitch either
You've Suffered RollBack.
RollBack is very annoying. Its when you log out, but it doesnt save, so it rolls back to the nearest point the server saved your character.
Roll Back is a method used for duping.
However, I will be putting an anti dupe method for that method, so dont try it
Id Reccomend waiting 20 seconds- 1 minute before you logout.
Just to make sure the server saves your character properly.
Thanks