congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Session.removeAttribute
Code IndexAdd Tabnine to your IDE (free)

How to use
removeAttribute
method
in
org.apache.shiro.session.Session

Best Java code snippets using org.apache.shiro.session.Session.removeAttribute (Showing top 20 results out of 315)

origin: apache/shiro

/**
 * Immediately delegates to the underlying proxied session.
 */
public Object removeAttribute(Object key) throws InvalidSessionException {
  return delegate.removeAttribute(key);
}
origin: apache/shiro

/**
 * Removes any existing subject state from the Subject's session (if the session exists).  If the session
 * does not exist, this method does not do anything.
 *
 * @param subject the subject for which any existing subject state will be removed from its session.
 */
protected void removeFromSession(Subject subject) {
  Session session = subject.getSession(false);
  if (session != null) {
    session.removeAttribute(DefaultSubjectContext.AUTHENTICATED_SESSION_KEY);
    session.removeAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
  }
}
origin: apache/shiro

private void clearRunAsIdentities() {
  Session session = getSession(false);
  if (session != null) {
    session.removeAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
  }
}
origin: stylefeng/Guns

/**
 * 移除shiro指定的sessionKey
 */
public static void removeSessionAttr(String key) {
  Session session = getSession();
  if (session != null)
    session.removeAttribute(key);
}
origin: apache/shiro

public void removeAttribute(String s) {
  try {
    Object attribute = getSession().removeAttribute(s);
    afterUnbound(s, attribute);
  } catch (InvalidSessionException e) {
    throw new IllegalStateException(e);
  }
}
origin: apache/shiro

public static SavedRequest getAndClearSavedRequest(ServletRequest request) {
  SavedRequest savedRequest = getSavedRequest(request);
  if (savedRequest != null) {
    Subject subject = SecurityUtils.getSubject();
    Session session = subject.getSession();
    session.removeAttribute(SAVED_REQUEST_KEY);
  }
  return savedRequest;
}
origin: apache/shiro

public Object removeAttribute(SessionKey sessionKey, Object attributeKey) throws InvalidSessionException {
  Session s = lookupRequiredSession(sessionKey);
  Object removed = s.removeAttribute(attributeKey);
  if (removed != null) {
    onChange(s);
  }
  return removed;
}
origin: apache/shiro

  private void tryToCleanSession(Session session) {
    Collection<Object> keys = session.getAttributeKeys();
    for (Object key : keys) {
      session.removeAttribute(key);
    }
  }
};
origin: apache/shiro

session.removeAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
origin: org.apache.shiro/shiro-core

/**
 * Immediately delegates to the underlying proxied session.
 */
public Object removeAttribute(Object key) throws InvalidSessionException {
  return delegate.removeAttribute(key);
}
origin: apache/shiro

if (existingAuthc != null) {
  session.removeAttribute(DefaultSubjectContext.AUTHENTICATED_SESSION_KEY);
origin: org.apache.shiro/shiro-core

/**
 * Removes any existing subject state from the Subject's session (if the session exists).  If the session
 * does not exist, this method does not do anything.
 *
 * @param subject the subject for which any existing subject state will be removed from its session.
 */
protected void removeFromSession(Subject subject) {
  Session session = subject.getSession(false);
  if (session != null) {
    session.removeAttribute(DefaultSubjectContext.AUTHENTICATED_SESSION_KEY);
    session.removeAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
  }
}
origin: org.apache.shiro/shiro-core

private void clearRunAsIdentities() {
  Session session = getSession(false);
  if (session != null) {
    session.removeAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
  }
}
origin: org.apache.shiro/shiro-core

public Object removeAttribute(SessionKey sessionKey, Object attributeKey) throws InvalidSessionException {
  Session s = lookupRequiredSession(sessionKey);
  Object removed = s.removeAttribute(attributeKey);
  if (removed != null) {
    onChange(s);
  }
  return removed;
}
origin: org.apache.shiro/shiro-core

session.removeAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
origin: org.apache.shiro/shiro-core

if (existingAuthc != null) {
  session.removeAttribute(DefaultSubjectContext.AUTHENTICATED_SESSION_KEY);
origin: yidao620c/SpringBootBucket

/**
 * 移除shiro指定的sessionKey
 */
public static void removeSessionAttr(String key) {
  Session session = getSession();
  if (session != null)
    session.removeAttribute(key);
}
origin: be.c4j.ee.security.octopus/octopus-core

private void clearRunAsIdentities() {
  Session session = getSession(false);
  if (session != null) {
    session.removeAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
  }
}
origin: cn.jeeweb/jeeweb-common-security

@SuppressWarnings("unchecked")
@Override
public V remove(K key) throws CacheException {
  V value = null;
  value = (V) getSession().removeAttribute(cacheKeyName);
  logger.debug("remove {} {}", cacheKeyName, key);
  return value;
}
origin: yjjdick/sdb-mall

public static String getKaptcha(String key) {
  Object kaptcha = getSessionAttribute(key);
  if(kaptcha == null){
    throw new RRException("验证码已失效");
  }
  getSession().removeAttribute(key);
  return kaptcha.toString();
}
org.apache.shiro.sessionSessionremoveAttribute

Javadoc

Removes (unbinds) the object bound to this session under the specified key name.

Popular methods of Session

  • getAttribute
    Returns the object bound to this session identified by the specified key. If there is no object boun
  • setAttribute
    Binds the specified value to this session, uniquely identified by the specifed key name. If there is
  • getId
    Returns the unique identifier assigned by the system upon session creation. All return values from t
  • getHost
    Returns the host name or IP string of the host that originated this session, or nullif the host is u
  • getTimeout
    Returns the time in milliseconds that the session session may remain idle before expiring. * A negat
  • getLastAccessTime
    Returns the last time the application received a request or method invocation from the user associat
  • getStartTimestamp
    Returns the time the session was started; that is, the time the system created the instance.
  • setTimeout
    Sets the time in milliseconds that the session may remain idle before expiring. * A negative val
  • getAttributeKeys
    Returns the keys of all the attributes stored under this session. If there are no attributes, this r
  • stop
    Explicitly stops (invalidates) this session and releases all associated resources. If this session h
  • touch
    Explicitly updates the #getLastAccessTime() of this session to the current time when this method is
  • touch

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Runner (org.openjdk.jmh.runner)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now