Add MongoSession.changeSessionId
This commit is contained in:
@@ -40,7 +40,7 @@ public class MongoSession implements Session {
|
||||
*/
|
||||
private static final char DOT_COVER_CHAR = '\uF607';
|
||||
|
||||
private final String id;
|
||||
private String id;
|
||||
private long createdMillis = System.currentTimeMillis();
|
||||
private long accessedMillis;
|
||||
private long intervalSeconds;
|
||||
@@ -66,6 +66,17 @@ public class MongoSession implements Session {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String changeSessionId() {
|
||||
String changedId = generateId();
|
||||
this.id = changedId;
|
||||
return changedId;
|
||||
}
|
||||
|
||||
private String generateId() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T getAttribute(String attributeName) {
|
||||
return (T) this.attrs.get(coverDot(attributeName));
|
||||
|
||||
Reference in New Issue
Block a user