Generate new ID for session (fixes #67)

Co-authored-by: https://github.com/ikq
This commit is contained in:
Martin Dosch 2024-03-28 15:53:09 +01:00
parent 07196efcf3
commit eedd7259cb

View File

@ -798,6 +798,7 @@ func (c *Client) init(o *Options) error {
} }
if o.Session { if o.Session {
// if server support session, open it // if server support session, open it
cookie = getCookie() // generate new id value for session
fmt.Fprintf(c.stanzaWriter, "<iq to='%s' type='set' id='%x'><session xmlns='%s'/></iq>\n", xmlEscape(domain), cookie, nsSession) fmt.Fprintf(c.stanzaWriter, "<iq to='%s' type='set' id='%x'><session xmlns='%s'/></iq>\n", xmlEscape(domain), cookie, nsSession)
} }