Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-622

Session Management page - Incorrect variable name in example

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Hide
      Like almost everything else in Shiro, you acquire a Session by interacting with the currently executing Subject:

      {code}
      Subject currentUser = SecurityUtils.getSubject();

      Session session = currentUser.getSession();
      session.setAttribute( "someKey", someValue);
      {code}

      The subject.getSession() method is a shortcut for calling currentUser.getSubject(true).
      Show
      Like almost everything else in Shiro, you acquire a Session by interacting with the currently executing Subject: {code} Subject currentUser = SecurityUtils.getSubject(); Session session = currentUser.getSession(); session.setAttribute( "someKey", someValue); {code} The subject.getSession() method is a shortcut for calling currentUser.getSubject(true).

    Description

      This is the documentation in this section:-

      http://shiro.apache.org/session-management.html#using-sessions

      Like almost everything else in Shiro, you acquire a Session by interacting with the currently executing Subject:

      Subject currentUser = SecurityUtils.getSubject();
      
      Session session = currentUser.getSession();
      session.setAttribute( "someKey", someValue);
      

      The subject.getSession() method is a shortcut for calling currentUser.getSubject(true).

      The variable subject does not exist in the code example. Did I misunderstand what the documentation was trying to say?

      Attachments

        Activity

          People

            Unassigned Unassigned
            kamal.bhatt@gmail.com Kamal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: