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

What is the purpose of a JSESSIONID suffix?

After using a browser to authenticate into my service, I find a cookie set with the following key\value pair: JSESSIONID=40d4b01c47ddb858718291d319a1a817d3037fdc6f2c341c195a94dc6ee8e8a1.e38Lb3qTb3aKai0RbxeMahqNbN90; path=/MyService; secure Note the…
Muhammad Gelbana
  • 3,890
  • 3
  • 43
  • 81
4
votes
3 answers

How to create session for login and logout in java

This is the code that I have written in login page HttpSession session = request.getSession(true); session.setAttribute("name", user1); String nme=(String) session.getAttribute("name"); And, This is the code for logout.jsp <%…
Madhavi Talla
  • 205
  • 2
  • 5
  • 12
4
votes
2 answers

mvc controller test with session attribute

I'm trying to test a method with this signature: @Autowired HttpSession http_Session; @RequestMapping(method=RequestMethod.GET, value="/search/findByName") public @ResponseBody List search(@RequestParam(value="name", required=true) String…
Alex2330
  • 347
  • 1
  • 7
  • 21
4
votes
2 answers

UnauthorizedSessionRequestException on WebSphere 8.5.5 with a vaadin web application when LTPA token expires

In our vaadin web application we get an UnauthorizedSessionRequestException when the LTPA token expires. The application is not responding anymore after that. The LTPA token expires even if the session is not inactive and the user does seomething.…
4
votes
1 answer

Are there issues with using Spring Security's HttpSessionSecurityContextRepository on CloudFoundry?

I understand that Spring Security's HttpSessionSecurityContextRepository makes use of HttpSession. Furthermore, I have read that PaaS such as CloudFoundry try to avoid session replication for the purpose of scalability. I intend to deploy an…
balteo
  • 23,602
  • 63
  • 219
  • 412
4
votes
1 answer

How to handle stateful OSGi services to maintain session state across bundle updates?

We have a scenario with a webapp implemented as a number of OSGi bundles. We want to do bundle updates to transparently deploy bugfixes etc to the running system. Assuming an update cycle with refresh and bundle restarts, this will cause problems…
mikewse
  • 457
  • 3
  • 11
4
votes
1 answer

Synchronizing on a instance variable in a session scoped spring-bean to limit concurrent requests to a legacy service

Due to a legacy system that doesn't handle multiple requests in parallell from the same user, I need to limit the amount of concurrent calls. The goal is to limit the number of concurrent requests to the service to 1 pr. user (session) - but not to…
Mads Mobæk
  • 34,762
  • 20
  • 71
  • 78
4
votes
1 answer

Accessing HttpSession outside of the originally receiving thread

I'm using Spring 3. When controller gets requests it passes control to method someMethod() annotated with @Async in Service bean and then returns. When I access in someMethod() HttpSession object I receive this…
Oleksandr Bondarenko
  • 1,998
  • 1
  • 19
  • 22
3
votes
1 answer

HttpSession safe

Where is servlet HttpSession stored? Is it safe to store sensitive information in HttpSession attributes. Can user maliciously modify session attributes?
Jor
  • 659
  • 7
  • 11
3
votes
3 answers

Which are the advantages of the Spring Session compared with Servlet HttpSession?

Which are the advantages of the Spring Session compared with Servlet HttpSession? Where should I use the Spring session?
3
votes
2 answers

How to Mock HttpSession and pass it as arguemnt to a method which works with session?

I am using Spring framework 2.4.4 and Intellij Ultimate 2020 I would like to test this method tryGetUser on which I am passing HttpSession, but I can't resolve the problem, because when I am mocking it and setAttribute(); at the //Arrange part of…
oneofakind
  • 33
  • 1
  • 7
3
votes
1 answer

ensuring per user request processing serialization in GAE/J

The default mode of google appengine is that each instance runs in single threaded mode. They handle concurrent requests by spawning new JVM instances if it is required. A new switch though allows appengine to handle multiple requests in parallel on…
cherouvim
  • 31,725
  • 15
  • 104
  • 153
3
votes
1 answer

Spring Boot session management with JWT

Can you assist me in this scenario? I am developing a mobile app where the session is not maintained at spring boot server side. Therefore I am using JWT which the client sends with every request. The client app is sending data along with the token…
Karar Haider
  • 31
  • 1
  • 2
3
votes
1 answer

JSF/Mojarra ExternalContext.redirect() creates a HttpSession

I'm playing with "stateless"/"transient" views in JSF and I noticed that invoking ExternalContext.redirect() causes a new session to be created. So, I dug into the Mojarra (2.2.15) code: // -> com.sun.faces.context.ExternalContextImpl:653 public…
Michele Mariotti
  • 7,372
  • 5
  • 41
  • 73
3
votes
1 answer

Embedded jetty: display all sessions in context

I recently moved a project that uses an embedded Jetty from version 6.1 to 9.4. It was easier than I expected. Now only one feature is left to migrate: The project has an administration tool, that shows all the loaded contexts (it can host more than…
Udo Klimaschewski
  • 5,150
  • 1
  • 28
  • 41