You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2013/03/20 16:53:31 UTC
git commit: WICKET-5103 update session id on detach as in Wicket 1.4.x
Updated Branches:
refs/heads/master d110e3073 -> 929e12839
WICKET-5103 update session id on detach as in Wicket 1.4.x
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/929e1283
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/929e1283
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/929e1283
Branch: refs/heads/master
Commit: 929e12839917135fb238fc602193d3e98d713ca9
Parents: d110e30
Author: svenmeier <sv...@apache.org>
Authored: Wed Mar 20 16:23:06 2013 +0100
Committer: svenmeier <sv...@apache.org>
Committed: Wed Mar 20 16:23:06 2013 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/wicket/Session.java | 21 +++++++++++---
1 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/929e1283/wicket-core/src/main/java/org/apache/wicket/Session.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Session.java b/wicket-core/src/main/java/org/apache/wicket/Session.java
index 7551b58..83e55d2 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Session.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Session.java
@@ -392,11 +392,8 @@ public abstract class Session implements IClusterable, IEventSink
{
if (id == null)
{
- RequestCycle requestCycle = RequestCycle.get();
- if (requestCycle != null)
- {
- id = getSessionStore().getSessionId(requestCycle.getRequest(), false);
- }
+ updateId();
+
// we have one?
if (id != null)
{
@@ -406,6 +403,15 @@ public abstract class Session implements IClusterable, IEventSink
return id;
}
+ private void updateId()
+ {
+ RequestCycle requestCycle = RequestCycle.get();
+ if (requestCycle != null)
+ {
+ id = getSessionStore().getSessionId(requestCycle.getRequest(), false);
+ }
+ }
+
/**
* Get this session's locale.
*
@@ -666,6 +672,11 @@ public abstract class Session implements IClusterable, IEventSink
{
invalidateNow();
}
+ else
+ {
+ // WICKET-5103 container might have changed id
+ updateId();
+ }
}
private void detachFeedback()