code: func (c *Context) SetSession(session Session, login bool) {
  	session.UserAgent = c.req.UserAgent()
  	session.IpAddress = strings.Split(c.req.RemoteAddr, ":")[0]
  	session.LastActiveTime = time.Now()
  	session.CallCount++
  
  	c.svc.sm.sessions[session.Key] = session
  	c.Session = &session
  
  	if login {
  		http.SetCookie(c.res, &http.Cookie{
  			Name:  soap.SessionCookieName,
  			Value: session.Key,
  		})
  
  		c.postEvent(&types.UserLoginSessionEvent{
  			SessionId: session.Key,
  			IpAddress: session.IpAddress,
  			UserAgent: session.UserAgent,
  			Locale:    session.Locale,
  		})
  	}
  }
docs: // SetSession should be called after successful authentication.