It is possible that there is some cookies issue, to determine why this is happening for some users and not others though you would need to be able to reproduce the issue first.
Are you using a cookies based cart or the regular session based cart? At what point do you set the userID in a session variable? Is it possible that the user making the purchase has not triggered this code that sets the session variable for their id? Also do you use this user id session variable for anything else in your site, if so do you have any problems with any of the other functionality?