Hello all RESTlet experts,

I am new to RESTful web services and RESTlet. WE only have experience
building servlet based web applications (Servlet/JSP on JBoss/Apache). Now,
we are building a RESTlet based application where the server side API would
be used by two types of clients - web using browser and swing based via
desktop.

What I understand is that as per REST concepts a) server can not maintain
sessions to improve scalability and few other reasons b) each request from
client should be self-contained

Now, I am really confused how to achieve this. Suppose we take a simple
shopping cart application.

Step 1) Client sends the authentication request, server authenticates and
server responds OK.

Step 2) Client sends a request to add an item to the shopping cart. Server
responds OK.

Step 3) Client sends another request to add 2nd item to the shopping card.
Server responds OK.

Normally, in a normally web app, a session is created in Step 1 on server
and from that point onwards all the requests pertaining to that client are
automatically associated with the same session and we store session state
(Shopping Cart in this case) in the session object and retrieve/update it
with subsequent requests from the client.

Now, in the above scenario:

1) how do we authenticate and authorize Client in Step 2 and 3 if there is
no session maintained on the server ?

2) does client need to send some additional information with each request ?

3) How do we retrieve the client specific Shopping Cart in Step 3 ?

4) Does the client need to send it's Shopping Cart that was created/returned
by server in Step 2 again in Step 3 ?

Obviously, this is the simplest use case and so every one developing RESTful
web services must be designing their app to handle this. What is the best
and most common way to handle session management, authentication,
authorization in RESTful web services using RESTLet ? If we have to maintain
cache on server side with the client's data then how is this different from
server maintaining sessions on our behalf ?

Thanks in advance, Deep


--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Sessions-in-web-applications-using-RESTlet-tp6876478p6876478.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2852570

Reply via email to