cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Current Session

alihammad
Champ in-the-making
Champ in-the-making
How can I get the current Sessions of JSF, Spring, Alfresco and JCR sessions.

I am working with JCR and Foundation API .. you can login with new credentails all the time but how can you get the current session.

This is how we can get session with new credentials

Session session = getJCRRepository().login(new SimpleCredentials(LOGIN, PASSWORD.toCharArray()));

but I want something like this

Session session = getCurrentSession (….)

I hope the question is clear
4 REPLIES 4

alihammad
Champ in-the-making
Champ in-the-making
any feedback??

mrogers
Star Contributor
Star Contributor
Assuming you are using Java, one way to do it would be to stick the session in a thread local variable.

alihammad
Champ in-the-making
Champ in-the-making
can you plz elaborate that a little bit.thank

alihammad
Champ in-the-making
Champ in-the-making
any more suggestions??