Is There any way to set session to my User Object?

0 votes
I want to set session id to my user object in Custome Code But unable to set it.
 
userobj = userService.getUser(user);
socialService.linkUserFacebookAccount(user, fbtoken);
Session session2 = sessionService.getSession(userobj.userName);
userobj.setSessionId(session2.getSessionId());
 
userobj.getSessionId(); ///This Returns Null
asked Jul 16, 2014 in Discuss & suggest API by ved (11 points)

1 Answer

0 votes
If your user is authenticated, you will get the sessionId along in userObject itself. In above stated code, if userObject reference is not changed, then it should return the sessionId if set earlier. Settings sessionId on userObject will set in the memory not on the server and can only be accessed till the lifetime of userObject. In your case, you have to make use of session service to get the sessionId of user whenever needed.

Let me know if it helps.

 

Ajay
answered Jul 16, 2014 by ajay123 (899 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...