Use crypto/rand, not math/rand, to generate session IDs.

math/rand always uses a deterministic seed. The sequence of session IDs
was therefore always the same:
	Uv38ByGCZU8WP18PmmIdcg
	lWbHTRDYaB0NhtHpHgAWeQ
	...

Multiple copies of this program would have had session ID collisions. I
don't know what the consequences of that would be.
This commit is contained in:
David Fifield 2017-06-29 16:00:29 -07:00
parent af8a026991
commit faeb8da8c9

View file

@ -8,7 +8,7 @@ import (
"io"
"io/ioutil"
"log"
"math/rand"
"crypto/rand"
"net"
"net/http"
"net/url"