Hi Florin, thank you for your write up, actually the main reason why I asked the original question was because I mainly write servlet based webapps currently but I've decided to use PHP for my next project mainly for exploratory reasons. On Sat, Mar 19, 2011 at 10:06 AM, Florin Jurcovici < florin.jurcovici@xxxxxxxxx> wrote: > Hi. > > Just for comparison: > > PHP does not provide sessions in the same way a servlet-based platform > provides. PHP actually destroys the in-mem representation of sessions > after each request is served, whereas a servlet-based platform caches > the sessions in mem between requests. > > ASP.Net also serializes session state, but not into a cookie - it uses > a hidden field instead. Which works around cookie size limitation. You > don't even have a choice of database sessions with ASP.Net. OTOH, even > if performance might suffer, scalability, as far as the sessions > mechanism is concerned, is excellent - you don't need session > replication. > > Servlet-based platforms provide the most complicated solution, when > compared to the other two. They keep sessions in mem, which improves > performance (no serialization/deserialization for each request), but > creates potential scalability problems. You won't hit the wall at a > few thousands of users, but replicating maybe a million sessions among > no more than a hundred servers causes the replication process to > consume quite a lot of resources, the resources being used for > replication increasing faster than linearly with each added server > (not quite exponentially, though). You can use sticky sessions with > most servlet-based platforms, but these come with their own problems > (already described by a previous poster). Nevertheless, in mem > sessions a la servlets are a very convenient mechanism to use - the > session replication is provided by the platform, and the app > programmer doesn't have to worry about it. > > All three approaches rely on every piece of data in the session being > serializable, so you can't store interesting objects, like an open > file or the like, in sessions. > > Does anybody know of any fundamentally different session > sharing/replication mechanism? > > br, > > flj > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Signed, Alessandro Ferrucci