cancel
Showing results for 
Search instead for 
Did you mean: 

IUser Value when session is out

former_member218672
Active Contributor
0 Kudos

Hi Guys,

Can you please tell me this.

When the user session is no longer avaliable i mean the session is out, what is the value for

com.sap.security.api.IUser ?

Any suggestion would be appreciated.

- prodyut

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Session is not related to IUser. IUser gets details about a user from the UME source. It doesn't know if the user is logged on or has a session.

former_member218672
Active Contributor
0 Kudos

Hi Mike,

Thanks for quick reply.

My question is what will happen if i try to get below user value through code when the session is no longer valid.

IPortalComponentRequest request = (IPortalComponentRequest) pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);

com.sap.security.api.iUser user=request.getUser();

What will the value of user when session is out/ user is not logged on/iUser fails to retrieve data from UME, i know session is not related with IUser.

- prodyut

Edited by: prodyut kumar sen on May 22, 2009 9:46 AM

Former Member
0 Kudos

Hi,

your question is somehow contradictorily

As you already stated by yourself session is not related to IUser.

Furthermore it cannot happen that you can execute this code without a valid user object, because when executing this code there is ALWAYS a request made by some user (you receive the IPortalComponentRequest object). Due to this the user is always logged on when making the request, there is no other way (if you go to the portal without entering username/password there exist anyway a user, that is to say the anonymous user)

former_member218672
Active Contributor
0 Kudos

Basically i am doing this in a jsp dynpage, so there i have written below code -

IPortalComponentRequest currentRequest = (IPortalComponentRequest) pageContext.getAttribute( javax.servlet.jsp.PageContext.REQUEST);

com.sap.security.api.IUser user= currentRequest.getUser();

Now, if i keep the iview corresponding to this dynpage till the session timeout is over, and tries to do work on this after that, I think currentRequest comes null or (?) so that this time user value in the code is coming null or (?)

because this time, the request itself is no longer valid, what will be the value of user this time. I need clarification on this. pls give me any idea.

Former Member
0 Kudos

Well I think you have a general misunderstanding of web applications...

The code you mentioned is only executed if the user does a request to your JSPDynpage. Then the request is finished and there will NOTHING be executed. You can imagine it like that your mentioned code doesn't exist anymore...

It is first again executed again when the user performs a new request and when this is the case your code will be run from the beginning again. So it doesn't matter how many time is elapsing between two requests.