httpsession

HTTPSession variable limit

こ雲淡風輕ζ 提交于 2019-11-29 10:57:21
What is the maximum limit (i.e. size) of data that a HTTPSession variable can hold? What will happen if this exceeds? And most importantly, what is the alternative approach to have the data throughout the session if the size exceeds the maximum size that a HTTPSession variable can hold? There is no limit, other than the memory of your server. The alternatives are to run your server with more memory to configure the server to swap sessions to disk (see http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html for Tomcat) to avoid putting large data in the session, and to use a cache or a

Websocket - httpSession returns null

怎甘沉沦 提交于 2019-11-29 09:21:57
I would like to make the connection between a websocket handshake \ session to a HttpSession object. I've used the following handshake modification: public class GetHttpSessionConfigurator extends ServerEndpointConfig.Configurator { @Override public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) { HttpSession httpSession = (HttpSession)request.getHttpSession(); config.getUserProperties().put(HttpSession.class.getName(),httpSession); } } As mentioned in this post: Accessing HttpSession from HttpServletRequest in a Web Socket

JSF - Session-scoped managed bean does not have dependencies re-injected on session deserialization

丶灬走出姿态 提交于 2019-11-29 09:18:31
问题 I'm not sure if what I'm doing is wrong, or if I just missed an annotation or configuration item somewhere. Here's the situation: I have a JSF application with a session-scoped bean named SessionData . This bean has an application-scoped bean reference (of type ApplicationData ) injected into it at creation time. This works ok when the session is first created. The dependency injection is done with <managed-bean> elements in the faces-config.xml file as shown here: <managed-bean> <managed

Session ID re-used after call to invalidate

*爱你&永不变心* 提交于 2019-11-29 02:32:40
I've inherited a pretty ancient JSP application (JDK 1.3.1_15) and am attempting to plug a session fixation hole. I'm successfully invalidating the current session after authentication using HttpSession.invalidate() however when the new session is created, the old session ID is re-used. <% // login.jsp if (authenticated) { request.getSession().invalidate(); // create new session and store data HttpSession session = request.getSession(); session.putValue(...); // etc response.sendRedirect("logged-in.jsp"); return; } %> I can see the new session assignment in my HTTP monitor, it's just using the

Tomcat, keep session when moving from HTTPS to HTTP

。_饼干妹妹 提交于 2019-11-28 20:49:32
I have a Java application running on Tomcat 6.0.29, with Apache 2.2.3 in front. The login page uses HTTPS, while most pages use HTTP. If a user tries to access a page (HTTP) that is login protected, he gets redirected to the login page (HTTPS), logs in, then gets redirected back to the originally requested page. This works great, as the JSESSIONID cookie is set as non-secure, and used for both HTTP and HTTPS. However, if the user starts at the login page (HTTPS), the JSESSIONID cookie is set as Secure, and thus the session is not available after login when redirecting to pages under HTTP,

How to check if a session is invalid

 ̄綄美尐妖づ 提交于 2019-11-28 17:15:11
How to check if a session is invalid or not? There is no method in the API . Is it the same as isNew() ? And what is the difference if not? If you want to know whether it valid based on a request: request.isRequestedSessionIdValid() or HttpSession sess = request.getSession(false); if (sess != null) { // it's valid } If you have stored a reference to the session and need to validate I would try { long sd = session.getCreationTime(); } catch (IllegalStateException ise) { // it's invalid } isNew() is true only if this session wasn't yet accepted by client (i.e. it was just created, and JSESSIONID

I can get property from a session attribute, but not from a session map

♀尐吖头ヾ 提交于 2019-11-28 13:06:51
I am using SSH2. When I try to got an attribute with <%=session.getAttribute("username") %> , it was just right. But when I tried to get the same attribute with <s:property value="#session.username" /> , I got nothing. Why? Aren't they the same? And when I used the <s:debug> , I got these: Servlet.service() for servlet jsp threw exception org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation

HTTP Session: how to configure URLs that not change the session expiration?

…衆ロ難τιáo~ 提交于 2019-11-28 10:26:43
问题 I have in my application polling HTTP requests that executed each 5 minutes. I want to configure those URLs not to change the session expiration. Otherwise my session will never expired (and I do not want it). Was not able to find it in the web.xml and HttpSession documentation. How is possible to do it? Added Very important clarification: the request should be authenticated. It means that the request should be attached to JsessionID that is already authenticated. Clarification (Added 2) I do

How to find out what open sessions my servlet based application is handling at any given moment

不问归期 提交于 2019-11-28 08:09:35
问题 I need to write a servlet that, when called, gets information about a list of the currently opened sessions. Is there a way to do this? 回答1: Implement HttpSessionListener, give it a static Set<HttpSession> property, add the session to it during sessionCreated() method, remove the session from it during sessionDestroyed() method, register the listener as <listener> in web.xml . Now you've a class which has all open sessions in the current JBoss instance collected. Here's a basic example:

HTTPSession variable limit

半城伤御伤魂 提交于 2019-11-28 04:23:18
问题 What is the maximum limit (i.e. size) of data that a HTTPSession variable can hold? What will happen if this exceeds? And most importantly, what is the alternative approach to have the data throughout the session if the size exceeds the maximum size that a HTTPSession variable can hold? 回答1: There is no limit, other than the memory of your server. The alternatives are to run your server with more memory to configure the server to swap sessions to disk (see http://tomcat.apache.org/tomcat-7.0