hi Prakash,
Answering your 1st question:
we don't need to design anything. All the scenarios shipped by SAP are pre-designed and takes care of all the scenario. we only need to do the configuration part(ID).
As far as design of Login and Logout is concerned as per my understanding everytime HCM system makes a call first login operation will be called then the session id generated will be fetched if login successfull and then the respective operation is carried and then once the operation is successfully executed logout is called and the session ID is expired.
This goes for every single operation that is carried from SAP HCM <--> SAP PI <--> Successfactor.
Hope that answers your question.
thanks and regards,
Praveen T