On Sunday, 25 March 2012 at 19:22:02 UTC, Adam D. Ruppe wrote:
On Sunday, 25 March 2012 at 19:14:32 UTC, dnewbie wrote:
I wonder how can I generate unique, non predictable session ids.

In web.d, there's a Session class that generates them
with std.random.uniform. I suspect this isn't the
best possible, but it's worked pretty well so far.

The session class also uses a file to store persistent
string key/value data.

While using std.random is probably good enough for most sites,
it's definitely worth keeping in mind that these session IDs are
far from non-predictable. Generally, a secure random number
generator is used instead, but Phobos lacks something like this.

Reply via email to