I am working on a shiny app where I am using bookmarks. So when host this app on shinyapps.io I am dont want other users to see the bookmarks which I did using my user login. I tried using User = Sys.getenv("LOGNAME"))
but it always returns the username as Shiny.
Asked
Active
Viewed 1,874 times
1 Answers
11
If you mean that you're using the shinyapps authentication, where users have to log in through shinyapps.io in order to see your app, then you can get the user's name using session$user
on the server side.
Make sure that your server function is defined as function(input, output, session)
rather than just function(input, output)

DeanAttali
- 25,268
- 10
- 92
- 118
-
I did add that session. But I get this error `Error bookmarking state: column or argument 5 is NULL` – SNT Jan 30 '19 at 16:47
-
That sounds like a separate issue. Perhaps try to isolate the problem (get it to reproduce with as little code as possible) and post another question – DeanAttali Jan 30 '19 at 16:59
-
My bad. Had to set the application to private . Then it works – SNT Jan 30 '19 at 17:04
-
I will add a second issue in that as a seperate question – SNT Jan 30 '19 at 17:14