did this work out for you?
When I do the following (to prevent session fixation):
HashMap<String, Object> attributes = new HashMap<String, Object>();
// copy/save all attributes
Enumeration<String> enames = httpSession.getAttributeNames();
while ( enames.hasMoreElements() )
{
String name = enames.nextElement();
if ( !name.equals( "JSESSIONID" ) )
{
attributes.put( name, httpSession
.getAttribute( name ) );
}
}
// invalidate the session
httpSession.invalidate();
// create a new session
httpSession = request.getSession( true );
// "restore" the session values
for ( Map.Entry<String, Object> et : attributes.entrySet() )
{
httpSession.setAttribute( et.getKey(), et.getValue() ); // <- java.lang.IllegalStateException: setAttribute: Session already invalidated
}
I get "java.lang.IllegalStateException: setAttribute: Session already invalidated"
What am I missing?