How Do i save inventory?

Sometimes it saves but most times i doesnt , i want my backpack to be sorted but it resets everytime i log back in!