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
-1
votes
1 answer

Session tracking does not persist

Here is my code. The HttpSession we used was also used in class and it worked but doesn't work now. And I cannot print anything after the for loop. I use doGet() method. We need to store the stringToPhone in a session object and the carrierNum to a…
whitecrow
  • 1
  • 2
-1
votes
1 answer

How to manage a User Session on a AWS server?

I have my backend in JAVA and website is hosted on AWS server(2 or more). What is the best possible way to handle a user session on my website? Looked into HTTPSession but the drawback with it is that session of one server will not have same…
akg
  • 670
  • 10
  • 30
-1
votes
1 answer

Session tracking in HttpSession or in Stateful Session Bean?

I want to develop a jsf web application like shopping cart and must have to login before shopping. How can i tracking each user session. What will be the best way in this situation. Track session in presentation layer (HttpSession) or Stateful…
user3302257
  • 69
  • 3
  • 11
-1
votes
1 answer

isNew returns false even when I have created a new session.Why is that ?

In the following snippet,uSession.isNewalways returns false. Why is that ? I create a new session but the corresponding method returns false. HttpSession uSession = request.getSession(); if(uSession.isNew()) {System.out.println("Inside if…
saplingPro
  • 20,769
  • 53
  • 137
  • 195
-1
votes
1 answer

HttpSession expires before timeout

In my web application I've set the session-timeout to 3 min. I keep pinging my app server every 30 sec through an ajax call. So Ideally the session should never expire until it is invalidated by logout action. But its getting expired in no…
Sudheendra
  • 29
  • 5
-2
votes
1 answer

Java HttpSessionListener: how to customize for different types of sessions?

I need to be able to differentiate between session categories; just like this: public final class MyHttpSessionListener implements HttpSessionListener { private static final AtomicInteger counterA = new AtomicInteger(); …
coderodde
  • 1,269
  • 4
  • 17
  • 34
-2
votes
1 answer

how to safely store hashmap in httpsession in java

If I store a concurrent hashmap in a httpsession then how can I use this hashmap in a threadsafe manner? by using the hashmap I mean adding and retrieving from the hashmap in a threadsafe manner. what object should I lock on while getitng/putting in…
-2
votes
2 answers

Disable HTTPSession for stateless web services

I would like to know if it is possible to disable the HTTPSession for an application server handling only web services RESTful. I don't know if there are specific application servers or servlet containers designed to handle micro RESTful web…
Davide Lorenzo MARINO
  • 26,420
  • 4
  • 39
  • 56
-2
votes
1 answer

What is wrong with HttpSession?

Hello i have the above code import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; public class CarSessionServlet2 extends HttpServlet { private String Brands[] = { "Audi", "Ford", "Toyota" }; …
ParisL
  • 1
  • 1
  • 6
-4
votes
1 answer

HttpSession does not work

I have following code segment in my servlet. Here, for some reason, I can not hold the session for the same user after creation of one session. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,…
Shahjalal
  • 1,163
  • 7
  • 21
  • 38
1 2 3
43
44