/** * Marks session state as dirty so that it will be re-stored in the ISessionStore * at the end of the request. * * @param forced * A flag indicating whether the session should be marked as dirty even * when it is temporary. If {@code true} the Session will be bound. */ public final void dirty(boolean forced) { if (isTemporary()) { if (forced) { dirty = true; } } else { dirty = true; } }
/** * Marks session state as dirty so that it will be re-stored in the ISessionStore * at the end of the request. * * @param forced * A flag indicating whether the session should be marked as dirty even * when it is temporary. If {@code true} the Session will be bound. */ public final void dirty(boolean forced) { if (isTemporary()) { if (forced) { dirty = true; } } else { dirty = true; } }
/** * Change the id of the underlying (Web)Session if this last one is permanent. * <p> * Call upon login to protect against session fixation. * * @see "http://www.owasp.org/index.php/Session_Fixation" */ public void changeSessionId() { if (isTemporary()) { return; } id = generateNewSessionId(); }
@Override public boolean isVisible() { return BrowserPanel.this.getSession().isTemporary() == false; } };
@Override public boolean isVisible() { return BrowserPanel.this.getSession().isTemporary() == false; } };
/** * checks on existing session, if there isn't one it will be created. * * @param session current session to bind */ protected void assertBoundSession(Session session) { if (session.isTemporary()) { session.bind(); } }
/** * Change the id of the underlying (Web)Session if this last one is permanent. * <p> * Call upon login to protect against session fixation. * * @see "http://www.owasp.org/index.php/Session_Fixation" */ public void changeSessionId() { if (isTemporary()) { return; } id = generateNewSessionId(); }
/** * @return whether the current session is temporary */ protected boolean isSessionTemporary() { return Session.exists() ? Session.get().isTemporary() : true; }
/** * Removes all pages from the session. Although this method should rarely be needed, it is * available (possibly for security reasons). */ public final void clear() { if (isTemporary() == false) { getPageManager().clear(); } }
/** * @return whether the current session is temporary */ protected boolean isSessionTemporary() { return Session.exists() ? Session.get().isTemporary() : true; }
/** * Removes all pages from the session. Although this method should rarely be needed, it is * available (possibly for security reasons). */ public final void clear() { if (isTemporary() == false) { getPageManager().clear(); } }
/** * checks on existing session, if there isn't one it will be created. */ private void assertBoundSession() { Session session = Session.get(); if (session.isTemporary()) { session.bind(); } } }
public ScriptExecutor getScriptExecutor() { Session session = Session.get(); String sessionId = session.getId(); ScriptExecutor executor = sessionId!=null?scriptExecutorsCache.get(sessionId):null; if(executor==null) { executor = new ScriptExecutor(); if(session.isTemporary()) session.bind(); scriptExecutorsCache.put(sessionId, executor); } return executor; } }
/** * @return List of attributes for this session */ protected final List getAttributeNames() { if (!isTemporary()) { RequestCycle cycle = RequestCycle.get(); if (cycle != null) { return getSessionStore().getAttributeNames(cycle.getRequest()); } } else { if (temporarySessionAttributes != null) { return new ArrayList(temporarySessionAttributes.keySet()); } } return Collections.EMPTY_LIST; }
/** * Any detach logic for session subclasses. This is called on the end of handling a request, * when the RequestCycle is about to be detached from the current thread. */ public void detach() { detachFeedback(); if (isSessionInvalidated()) { invalidateNow(); } else if (!isTemporary()) { // WICKET-5103 container might have changed id updateId(); } }
/** * Any detach logic for session subclasses. This is called on the end of handling a request, * when the RequestCycle is about to be detached from the current thread. */ public void detach() { detachFeedback(); if (isSessionInvalidated()) { invalidateNow(); } else if (!isTemporary()) { // WICKET-5103 container might have changed id updateId(); } }
protected void onBeforeRender() { super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !isPageStateless()) { getSession().bind(); } }
@Override protected void onBeforeRender() { // Make sure it is really empty renderedComponents = null; // rendering might remove or add stateful components, so clear flag to force reevaluation stateless = null; super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !peekPageStateless()) { getSession().bind(); } }
@Override protected void onBeforeRender() { // Make sure it is really empty renderedComponents = null; // rendering might remove or add stateful components, so clear flag to force reevaluation stateless = null; super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !peekPageStateless()) { getSession().bind(); } }
/** * * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !peekPageStateless()) { getSession().bind(); } }