details: https://code.openbravo.com/erp/devel/pi/rev/67bb1feb836a
changeset: 24304:67bb1feb836a
user: Rafa Alonso <rafael.alonso <at> openbravo.com>
date: Tue Aug 19 12:39:04 2014 +0200
summary: Fixes issue 27370: If the session is invalidated while retriving,
changing or removing session attributes,
- the session will end
- the console log will properly report that the session was invalidated
Methods involved (setSessionValue was fixed wth the above changeset):
- getSessionValue
- setSessionValue
- removeSessionValue
diffstat:
src-core/src/org/openbravo/base/VariablesBase.java | 9 +++++++--
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java | 5 ++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diffs (48 lines):
diff -r 48002b8ae52b -r 67bb1feb836a
src-core/src/org/openbravo/base/VariablesBase.java
--- a/src-core/src/org/openbravo/base/VariablesBase.java Fri Aug 22
13:44:46 2014 +0200
+++ b/src-core/src/org/openbravo/base/VariablesBase.java Tue Aug 19
12:39:04 2014 +0200
@@ -1321,6 +1321,8 @@
auxStr = (String) session.getAttribute(sessionAttribute.toUpperCase());
if (auxStr == null || auxStr.trim().equals(""))
auxStr = defaultValue;
+ } catch (final IllegalStateException ise) {
+ throw new IllegalStateException(ise);
} catch (Exception e) {
auxStr = defaultValue;
}
@@ -1344,7 +1346,9 @@
if (!attribute.equalsIgnoreCase("menuVertical"))
if (log4j.isDebugEnabled())
log4j.debug("Set session attribute: " + attribute + ":..." +
value.toString());
- } catch (Exception e) {
+ } catch (final IllegalStateException ise) {
+ throw new IllegalStateException(ise);
+ } catch (final Exception e) {
log4j.error("setSessionValue error: " + attribute + ":..." + value);
}
}
@@ -1360,7 +1364,8 @@
if (log4j.isDebugEnabled())
log4j.debug("Remove session attribute: " + attribute + ":..." +
getSessionValue(attribute));
session.removeAttribute(attribute.toUpperCase());
-
+ } catch (final IllegalStateException ise) {
+ throw new IllegalStateException(ise);
} catch (Exception e) {
log4j.error("removeSessionValue error: " + attribute);
}
diff -r 48002b8ae52b -r 67bb1feb836a
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java Fri Aug
22 13:44:46 2014 +0200
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java Tue Aug
19 12:39:04 2014 +0200
@@ -346,7 +346,10 @@
roleError.setType("Error");
roleError.setMessage(msg);
invalidLogin(request, response, roleError);
-
+ return;
+ } catch (final IllegalStateException ise) {
+ log4j.error("HTTPSecureAppServlet.service() - exception caught: ", ise);
+ invalidateSession(request);
return;
} catch (final Exception e) {
// Re-login
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits