I see to possibilities that could cause that:
- Your server switches between online and offline IDs
- for some reason, your server does not write the player save files correctly
Check your server-log for the messages when your friend connects, you should see a message telling you the player-id of your friend.
Check your server-worlds directory, if you find files with that player-ID in your world save below the following folders.
in each of the folders you should find a file with the player-id of your friend.
Check if the "last modified" time changes, after your friend plays on your server.
If not you could try to run the
/save-all command on your server before you close the server.
if the files still are not saved, check if your server has write permissions on this files, and if there is a "readonly" flag on the files.