Solution 1: Use the user IP address
Which you can get with session$request$REMOTE_ADDR
(for details see also this question at SO). Disadvantage: of course, users can hide their address behind a proxy. And many users do not have unique IPs to begin with.
Solution 2: Use all the settings from session$clientData
to create a user profile that goes beyond just the IP. But you can switch browsers. You can switch to different devices, etc.
Solution 3: Set a cookie. See this SO question (which only looks at session cookies though). Disadvantages: you have to ask users to permit cookies and they can always delete them.
Solution 4: the best solution I can think of is a 3rd party tracking tool like Google analytics or Mamoto. Such tools provide a user id. You can find more about this in the Shiny articles.
Such tools provide snippets of Javascript code that you need to include in the HTML head:
ui <- fluidPage(
tags$head(tags$script(HTML(
// Copy and paste from 3rd party tool
))),
...
)