[opencms-dev] RE: Logout without invalidating session

Dusty_it i.dastolfo at smart.it
Fri Jan 26 12:14:46 CET 2007


Hi,
      I tried another workaround, but it doesn't work and I don't know
why...

Simply, during before calling CmsJspBean.logout I save all session
attributes in a HashMap, call logout and then I put again the saved
attributes in the session. Here is the snippet:

Map objs = new HashMap();
for (Enumeration i = session.getAttributeNames() ; i.hasMoreElements() ; ) {
	String key = (String) i.nextElement();
	objs.put(key, session.getAttribute(key));
}
cms.logout(); // questa operazione distrugge la sessione

session = request.getSession(true);
for (Iterator i = objs.keySet().iterator() ; i.hasNext() ; ) {
	String key = (String) i.next();
	session.setAttribute(key, objs.get(key));
}

When I switch to another page I found that the user is still in...


Sebastian Himberger wrote:
> 
> Hi,
> 
> have a look at: http://www.opencms.org/bugzilla/show_bug.cgi?id=961 .
> IMHO it would be the best to add a method to CmsSessionManager which
> logs out the user.. but: In DEV_7_0 there's a
> CmsSessionManager#switchUser(...) method which you could use to switch
> the user to the guest user. So you could eventually backport this method
> if you really need this functionality.
> 
> best regards
> Sebastian
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/Logout-without-invalidating-session-tf3065604.html#a8649420
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list