Without reinventing the wheel, what I can use to manage user sessions in a web application and being able to respond with JSON to ajax requests?

Is there some framework (made for example with Indy components or something like this)?

Note for bounty:

in practice it is enough for me to have a reply with a clear example of a server application that serves json. Somehow a Delphi example of the php example mentioned HERE. (without the DB part, I want to see the basics of what does it mean to send JSON. I have basic knowledge of TIdHTTPServer.)

A request is a request, does not mind if it is ajax or not on the client side. You may want to update your question to ask just for session management.
–
jachguateDec 13 '10 at 18:34

1

@jachguate: Session management is just part of the request implementation. You'll have to parse the query, then retrieve the data, then create the JSON response. And AJAX introduces new specifications about the JSON format.
–
Arnaud BouchezDec 13 '10 at 18:37

@A.Bouchez: Can you tell me what is different in the json format when you serve it over an ajax request from what you serve if the request is not ajax?
–
jachguateDec 14 '10 at 15:00

1

@jachquate: It depends on the UI components or the JavaScript code which will consume the JSON content. For instance, see synopse.info/forum/viewtopic.php?pid=97#p97 for diverse JSON layout (one ready for AJAX, with all property names, and one not expanded format, better for a Delphi client), and the link to Yahoo grid URI and JSON encoding expectations.
–
Arnaud BouchezDec 14 '10 at 16:05

Thanks, this is very informative, I don't have time to install Delphi XE Enterprise trial (I have the professional) and run the examples by the end of bounty. Could you please summarize what I get "out of the box" with datasnap xe compared to create all from scratch with webbroker? I guess by reading titles of whitepape: sessions management, authentication and then? (I mean which are the advantages of datasnap xe in my particular case)
–
user193655Jun 1 '11 at 7:17

Basically in Datasnap if you have a function returning an object Datasnap will serve it automatically as json. Refer to OBJECTS AND MARSHALING on page 29 in the .pdf
–
TotoJun 1 '11 at 10:14

Thanks for the reply. What I am looking for it is a Delphi framework for creating a backend to a web application. I am planning to use Sencha Touch for the UI (and this is why I don't want to use things like Intraweb). I have lot of code that I can reuse, this is why I am looking for a Delphi backend (and moreover because it is the only language I am proficient at). The autentication I need is the classical User/Password, it is not a real DB autenthication, even if under the hood I use DB users for autenthication, but then all connections are done through a single user. So pooling is possible.
–
user193655Dec 15 '10 at 9:13

Do you think that framework will allow me to generate a web application that uses Sencha Touch (or any javascript framework) without suffering too much? (otherwise said: is there already a working application to check? Or which alternatives do you suggest for managing autenthication?
–
user193655Dec 15 '10 at 9:17

Sencha Touch belongs the same family as ExtJS. So for avoiding much "suffering", I'd recommend taking a look at ExtPascal or Raudus, which are dedicated to ExtJS: stackoverflow.com/questions/3022378/… But be aware of the ExtJS/SenchaTouch license, which is not Open Source for all uses.
–
Arnaud BouchezDec 16 '10 at 7:46