title: How to access session$user in Shiny using Shiny Pro
body: <p>I have a simple shiny app that I am testing SHINY pro and I would like to access the session$user like the documentation suggests:</p>
  
  <p><a href="http://rstudio.github.io/shiny-server/latest/#flat-file-authentication" rel="nofollow">http://rstudio.github.io/shiny-server/latest/#flat-file-authentication</a>.  See section 4.1 which shows this code:</p>
  
  <pre><code>shinyServer(function(input, output, session) {
    output$username &lt;- reactive({
      session$user
    })
  </code></pre>
  
  <p>That code works but I need to access session$user in the ui.r file via the GetUser() function</p>
  
  <p>Here is my ui.r File:</p>
  
  <pre><code>library(shiny)
  shinyUI(fluidPage(
    textOutput("HeaderTime"),
    sidebarPanel(
      selectInput("t",   "t:",  as.character(GetUser()), selected = as.character(GetUser())), width = 2
    ),
    mainPanel(
      tabsetPanel(
        tabPanel("test",
                 dataTableOutput("Table"), 
                 plotOutput("Plot"),
  #                verbatimTextOutput("Txt"),
                 width = 12
        )
      )
    )
  ))
  </code></pre>
  
  <p>You can see the GetUser() function in the selectInput. I have placed GetUser() in my server.R file here:</p>
  
  <pre><code>shinyServer(function(input, output, session) {
  
    GetUser&lt;-reactive({
      return(session$user)
    })
  
  output$Plot&lt;-renderPlot({
  
    hist(rnorm(1000))
  })
  
  
  output$Table&lt;- renderDataTable({ 
    data.frame(a=c(1,2,3,4),b = c("TEst","test","test","test"))
  })
  
  })
  </code></pre>
  
  <p>when I run this code I get the error:</p>
  
  <pre><code>Error in GetUser() : argument "session" is missing, with no default
  </code></pre>
  
  <p>Any idea how to allow the ui.r to access GetUser() in the server.r file so session$user can be used in the ui?</p>
  
  <p>Here is code to run project:</p>
  
  <pre><code>library(rJava)
  library(shiny)
  install.packages("shiny")
  runApp("C://me/pathtoproject")
  </code></pre>
  
  <p>Thank you.</p>