Best way to support multiple users safely?

This has gone a bit off-topic, but let me ask this about supporting users ...

For a web app, if you need to save/restore the state of the app, then you can use the equivalent of INI files (ie., anything that gets you that) without regard to the user.

If you need to maintain the state of different users, then you need to implement a way to support user-based sessions where the users need to identify themselves, possibly by logging-in or some other kind of authentication. Cookies can be used to extend a session for a time.

Alternatively, you could pull the session info from a surrounding context, like a plugin or addon for Wordpress, or a connection to some other service (eg., how Zapier or IFTTT work). This is also how Windows works, because apps execute within the currently logged-in user's context; so Win apps typically don't need to worry about it or at least bother the user.

Are there any other options?