When you write a server program to handle requests across a network or the Internet, you often ask the user to sign-in with a username and password. From that point on, each request to your server program needs to run with the authority of that user.
This installment of Carsten Flensburg’s APIs by Example shows us how to swap user profiles. By “swap,” I mean that it switches to another user profile, performs a task, and then switches back. In this case, the “task” is to set the user’s “last sign-on date” and “last sign-on time.”
Download the save file containing the source code.