Hi Deepal,

Thanks a lot for your suggestion it worked for me relly nice.

Thanks 
Amardeep Singh

AmardeepSingh wrote:
> 
> Hi All,
> 
> I am facing some problem in implementing session management while using
> axis2. It will be great if anyone can help me out with few queries.
> 
> My Scenario: The scenario which I am trying to implement is very simple
> one.
> Basically I have a service implementation class which has a Login and
> couple
> of business methods. Now from a client when I call Login method of the
> service I  pass user name and password. At the server my service class
> authenticate the user and sends response back to client with the session
> id.
> I am trying to implement transport session so at client I am able to see
> session using this code snippet :
> 
> 
> 
> stub = *new* MyStub(*serviceUrl*);
> 
> client = stub._getServiceClient();
> 
> Options opt = client.getOptions();
> 
> opt.setTimeOutInMilliSeconds(600000);
> 
> opt.setManageSession(*true*);
> 
> client.getServiceContext().getProperty(HTTPConstants.HEADER_COOKIE);
> 
> 
> 
> Sample value of session id:JSESSIONID=61F54A15234AD93EB70F63B05DC0A6C1;
> 
> 
> This is all fine till here. Now if in the Login method the user
> authentication fails the session id which the server should sent to the
> client should be null , so that if the user tries to access my other
> business methods he should not be able to do that. Basically I need a way
> to
> control sessionId at the server only.
> Right now i am trying to set sessionId to null using this code snippet:
> 
> 
> MessageContext msgContext=MessageContext.*getCurrentMessageContext*();
> 
> SessionContext sessionContext=msgContext.getSessionContext();
> 
> sessionContext.setProperty(HTTPConstants.
> *HEADER_COOKIE*,*null*);
> 
> msgContext.setSessionContext(sessionContext);
> 
> But at my client i am still getting the sesssionId as not-nCan you please
> suggest a way of doing this.
> 
> 
> 
> Thanks in advance.
> 
> Amardeep Singh Khera
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Queries-regarding-session-managment-in-axsi2-tp23427265p23558283.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to