org.eclipse.jetty.server.Response.addCookie()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.eclipse.jetty.server.Response.addCookie方法的一些代码示例,展示了Response.addCookie的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.addCookie方法的具体详情如下:
包路径:org.eclipse.jetty.server.Response
类名称:Response
方法名:addCookie

Response.addCookie介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.jetty/jetty-security

s.setAttribute(Session.SESSION_CREATED_SECURE, Boolean.TRUE);
if (s.isIdChanged() && (response instanceof Response))
  ((Response)response).addCookie(s.getSessionHandler().getSessionCookie(s, request.getContextPath(), request.isSecure()));
if (LOG.isDebugEnabled())
  LOG.debug("renew {}->{}", oldId, s.getId());

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty/server

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: jenkinsci/winstone

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionHandler != null && !_sessionHandler.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (getResponse().isCommitted())
    throw new IllegalStateException("Response is committed");
  if (_sessionHandler == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionHandler.newHttpSession(this);
  HttpCookie cookie = _sessionHandler.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_CREATED_SECURE, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: Nextdoor/bender

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
if (abstractSession.isIdChanged() && response != null && (response instanceof Response))
  ((Response)response).addCookie(abstractSession.getSessionManager().getSessionCookie(abstractSession, request.getContextPath(), request.isSecure()));
LOG.debug("renew {}->{}",oldId,abstractSession.getId());

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (getResponse().isCommitted())
    throw new IllegalStateException("Response is committed");
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: jenkinsci/winstone

@Override
public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof Session)
  {
    Session s =  ((Session)session);
    s.renewId(this);
    if (getRemoteUser() != null)
      s.setAttribute(Session.SESSION_CREATED_SECURE, Boolean.TRUE);
    if (s.isIdChanged() && _sessionHandler.isUsingCookies())
      _channel.getResponse().addCookie(_sessionHandler.getSessionCookie(s, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
if (abstractSession.isIdChanged() && response != null && (response instanceof Response))
  ((Response)response).addCookie(abstractSession.getSessionManager().getSessionCookie(abstractSession, request.getContextPath(), request.isSecure()));
LOG.debug("renew {}->{}",oldId,abstractSession.getId());

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.security

abstractSession.setAttribute(AbstractSession.SESSION_CREATED_SECURE, Boolean.TRUE);
if (abstractSession.isIdChanged() && response != null && (response instanceof Response))
  ((Response)response).addCookie(abstractSession.getSessionManager().getSessionCookie(abstractSession, request.getContextPath(), request.isSecure()));
LOG.debug("renew {}->{}",oldId,abstractSession.getId());

代码示例来源:origin: Nextdoor/bender

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (getResponse().isCommitted())
    throw new IllegalStateException("Response is committed");
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: Nextdoor/bender

abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
if (abstractSession.isIdChanged() && response != null && (response instanceof Response))
  ((Response)response).addCookie(abstractSession.getSessionManager().getSessionCookie(abstractSession, request.getContextPath(), request.isSecure()));
LOG.debug("renew {}->{}",oldId,abstractSession.getId());

相关文章