in reply to Secure Session ID values

Picking something that generates unique values is very importiant. If your application ends up being distributed across multiple web servers, will your session id generator still generate provably unique ids?

One security aspect revolves around issues of session hijacking. If an attacker can repeatedly request new session ids untill they figure out how the generator works, they may be able to predict valid session ids, and use them to access (hijack) sessions of your active users. For an ecommerce site, this can be a serious issue. Generating a duplicate id can lead to 2 users sharing the same session - possibly exposing sensitive information from one user to the other.

There is a discussion about some of this in the book Writing Apache Modules with Perl and C.

Some techniues that I've seen used are to embed the user's ip address in the session id, and to append an md5 sum computed from the session id plus some information on the server (that is only available on the server). The appended md5 sum can then be used to validate that the id was generated by your website, and the ip address can be validated against the remote user's ip. That simple validation goes a long way toward thwarting session hijacking.