Questions tagged [httpsession]

An Java interface used by the servlet container to create a session between an HTTP client and an HTTP server.

An Java interface used by the servlet container to create a session between an HTTP client and an HTTP server. The session object has an expiration time which allows the container to invalidate the session after that specified time of the user inactivity. It is active while the user making requests, across more than one connection or page and remains active after the user exit application and stay active until it's expired. The server persists the session object for the user between restarts. While it's valid the session interface allows the application to bind objects to it and access then from different requests of the same user. A session usually corresponds to one user, who may visit a site many times. The server can maintain a session in many ways such as using cookies or rewriting URLs.

Details from the API docs:

Tutorials:

655 questions
2
votes
1 answer

httpsession doesn't expires when reverse Ajax is enabled

I have a web application that uses DWR reverse Ajax (pollAndCometEnabled set to true) In my web.xml i have set a timeout of 30 minutes for the HttpSession. Since DWR polls the server, the http session is always active and the result is that it never…
max
  • 21
  • 2
2
votes
1 answer

GWT - RemoteService interface and Spring - how to get HttpSession?

I am using GWT (2.5) with RPC, Spring and Postgresql for my project. My issue is about HttpSession handling . All queries to server are dispatched by Spring (DispatchServlet) to my GwtController (extends RemoteServiceServlet) . The particular…
Devin Konny
  • 161
  • 1
  • 9
2
votes
1 answer

Deprecation warning while implement HttpSession

While I'm trying to implement HttpSession, I should override getSessionContext method. But it casues deprecated warnings because the method and its return type HttpSessionContext is deprecated. @deprecated javadoc tag fixes a warning on the…
npcode
  • 1,370
  • 1
  • 14
  • 29
2
votes
2 answers

java servlet session maintain

I have develop servlet for generate Captcha code & add session name code Generate Capta-code import javax.servlet.*; import java.io.*; import java.awt.*; import java.util.Random; import java.awt.image.*; import javax.imageio.*; import…
mcacorner
  • 1,304
  • 3
  • 22
  • 45
2
votes
1 answer

how to add session id using URLConnection

I am trying to upload an image to a server using server url. For this i am using java.net api. After sending request , it is returning a response that shows session invalid. I am getting the session id from that server but unable to add it. How can…
Rasmikanta Guru
  • 41
  • 1
  • 2
  • 8
2
votes
1 answer

is @Autowired HttpSession thread safe in springmvc?

I'm using HttpSession object in Spring MVC with @Autowired: public abstract class UserController { @Autowired public HttpSession session; @RequestMapping(value = { "" }, method = { RequestMethod.GET }) public ModelAndView index(){ …
snageyang
  • 59
  • 1
  • 6
2
votes
2 answers

Easy way to clean up the invalidated sessions from a Java Web Application's memory

I know session.invalidate() releases the httpsession. But when I monitor the container memory, it does not come down. Here is what I am observing - Login (My application creates a session) User performs some activity that increases the process…
user1401472
  • 2,203
  • 3
  • 23
  • 37
2
votes
1 answer

HttpSession expires on page refresh

I'm new to JSF and I was doing some research about Scopes and Http session lifecycles, but one thing was not clear to me. I know that is possible to store variables using sessionMap from ExternalContext, and it used to work very fine for what I…
Tinadm
  • 359
  • 3
  • 16
2
votes
1 answer

Jetty with JDBCSessionManager and spring web security

In my application I have an embedded jetty server (version 8.1.2) running a web application that uses spring web security. The jetty server is configured to use the JDBCSessionManager One of the security filters that spring employs is a subclass of…
dankilman
  • 886
  • 2
  • 9
  • 18
2
votes
2 answers

Programmatic invalidation of HttpSession

Is it possible to terminate a logged in user's HttpSession? We can do the following from within the user's session: HttpSession s = request.getSession(false); s.invalidate(); // make sure s != null But how can an Admin-User 'kick-out' a given…
kmansoor
  • 4,265
  • 9
  • 52
  • 95
2
votes
1 answer

HTTPSessionListener using Spring injections and Services => impossible to access my beans

I work on a web app using Spring annotations to inject my Controllers and Services. In the app, I have users working on projects but I need to make sure one project is only edited by one user at a time so I have an attribute in the table "Project"…
2
votes
2 answers

Session persistence in development mode with Google App Engine

I've enabled sessions in App Engine which works perfectly well when the app is deployed. My problem is that this does not appear to work in development mode. I need something to persist sessions somewhere (disk, datastore, memory) in development…
tangent
  • 388
  • 1
  • 4
  • 14
2
votes
1 answer

DWR Cookie (DWRSESSIONID) and its use

Was wondering what is the use of DWRSESSIONID that is generated by DWR and sent to the browser? Is it associated with HTTPSession ? Don't see any practical reasons to create this cookie, when JSESSIONID is used to maintain state.
Darth_Yoda
  • 93
  • 2
  • 10
2
votes
2 answers

Invalidating session

When a user has an associated HttpSession object and then want to "log out" of the application you would invalidate that HttpSession which in turn would remove it from the map that the ServletContext keep of all sessions. But this only removes it on…
user626912
  • 2,546
  • 3
  • 24
  • 33
1
vote
2 answers

Creating a session with specific session ID

thank you you guys for looking at my post. Due to grey areas in licensing issues, I have two instances of tomcat running. I'm using Apache proxy to seamlessly communicate between the two. App1 lives in tomcatA. App2 lives in tomcatB. Both requires…
Monir
  • 840
  • 1
  • 10
  • 27