func (s *IdentityService) UpsertWebSession(user, sid string, session services.WebSession, ttl time.Duration) error {
	bytes, err := json.Marshal(session)
	if err != nil {
		return trace.Wrap(err)
	}
	err = s.backend.UpsertVal([]string{"web", "users", user, "sessions"},
		sid, bytes, ttl)
	if trace.IsNotFound(err) {
		return trace.NotFound("user '%v' is not found", user)
	}
	return trace.Wrap(err)
}
// UpsertWebSession updates or inserts a web session for a user and session id
UpsertWebSession updates or inserts a web session for a user and session id
// UpsertWebSession updates or inserts a web session for a user and session id
func (s *IdentityService) UpsertWebSession(user, sid string, session services.WebSession, ttl time.Duration) error {
	bytes, err := json.Marshal(session)
	if err != nil {
		return trace.Wrap(err)
	}
	err = s.backend.UpsertVal([]string{"web", "users", user, "sessions"},
		sid, bytes, ttl)
	if trace.IsNotFound(err) {
		return trace.NotFound("user '%v' is not found", user)
	}
	return trace.Wrap(err)
}
func ( s * IdentityService ) UpsertWebSession ( user , sid string , session services . WebSession , ttl time . Duration ) error { bytes , err := json . Marshal ( session ) if err != nil { return trace . Wrap ( err ) } err = s . backend . UpsertVal ( [ ] string { " " , " " , user , " " } , sid , bytes , ttl ) if trace . IsNotFound ( err ) { return trace . NotFound ( " " , user ) } return trace . Wrap ( err ) }
UpsertWebSession updates or inserts a web session for a user and session id
UpsertWebSession updates or inserts a web session for a user and session id