It used to be you only gained rest xp if you logged off in the inn room. They changed that fairly early on, and now you gain rest xp simply by being in a 'sanctuary' area (usually a town).

There's no difference in the amount of rest xp gained. It seems to be simply coded in to the effect of sanctuary (along with changing skills/classes without cooldown)