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
5
votes
4 answers

Cannot resolve Struts2 NotSerializableException even after update to 2.3.12

I currently doing a work with struts2 and this error suddenly appears. Some cache of my objects is not working. I use JBoss 5 and struts2 : struts2-core-2.3.4.1.jar xwork-core-2.3.4.1.jar The stack trace is here : http://pastebin.com/QpPV01wX this…
daimagine
  • 61
  • 2
  • 8
5
votes
1 answer

HttpSession timeout does not happen with jquery polling

We are using short polling in Jquery to periodically send ajax requests to server to check if there are any updates on the server. polling works fine but because of this, session is always kept active. And the session never gets timedout unless user…
Ekanath
  • 133
  • 1
  • 1
  • 8
5
votes
2 answers

How to obtain an HttpSession Object from SessionID?

I want to invalidate sessions of users based on some Event. I store their sessionID, how to get their HttpSession from this ID? The HttpSessionContext class is deprecated with no replacement.
Bahaa Zaid
  • 1,449
  • 2
  • 16
  • 22
4
votes
1 answer

Spring Security: same SecurityContext-instance in multiple ThreadLocals, how does that work?

Ive some questions about Spring Security 3.0.5 and the SecurityContext. First of all, Ill try to conclude what I know: SecurityContextHolder stores SecurityContext Between Request, SecurityContext is stored in HttpSession Begin of Request:…
4
votes
1 answer

How to use the Poco C++ HTTPSessionFactory

How is the best, simplest way to set up the HTTPSessionFactory to handle both HTTP and HTTPS? I know that I need to use HTTPSessionInstantiators, but I could really use a short and sweet example. Thanks.
4
votes
1 answer

Spring Server/Client Sessions and Hibernate Sessions

I use Spring 3 and Hibernate 3.6 for developing a webapplication - Im new and Im wondering if I really understand how sessions are working. Is it correct, that the Sessions between Server and Client, identified by a session id, are different from…
nano7
  • 2,455
  • 7
  • 35
  • 52
4
votes
3 answers

How to set session attributes in Spring Boot?

I want to set a session attribute with the name that is send by user. User will first login in. And when he logged in I want that his username will set as session attribute. What should I do? This is my controller: @GetMapping("/login") public…
Manish Bansal
  • 819
  • 2
  • 8
  • 19
4
votes
1 answer

Why calling invalidate() in HttpSessionListener doesn't give StackOverflowError?

I have a jsp file and a HttpSessionListener to monitor HttpSession destroying activities. index.jsp <% HttpSession s = request.getSession(); System.out.println("SID1 : " + s.getId()); s.setAttribute("Key", "Value"); …
Roshana Pitigala
  • 8,437
  • 8
  • 49
  • 80
4
votes
1 answer

HTTPSession with GWT

I'm new in GWT ... I would like to implement sessions in my Web App Basically I want that a session starts at the click of a button (handle an event) and ends at the click of another button (other handle an event). It's possible? How to do it step…
JackDaniels
  • 77
  • 1
  • 2
  • 7
4
votes
3 answers

Can't access HttpSession in Spring MVC @Controller class

I have a controller class in Spring MVC project. My code is like below: @Controller public class MainController { @RequestMapping(value = "/doLogin") public String login(@RequestParam("email") String email, @RequestParam("pwd") String password,…
Joshgun
  • 372
  • 3
  • 16
4
votes
3 answers

How unique is HttpSession.getId()?

Is the value returned by HttpSession.getId() guaranteed to be unique across time -- or only unique among all active sessions? In other words, can I use it as a key for a session log entry (which user logged in when and for how long)? If getId is…
Tony the Pony
  • 40,327
  • 71
  • 187
  • 281
4
votes
2 answers

Accessing HttpSessionState (HttpContext.Current.Session) from another thread or tricks?

We have a web site which implements a central HttpSessionState management in App_Code like this: public static class CurrentSession { public static HttpSessionState Session { get { return…
VSP
  • 2,367
  • 8
  • 38
  • 59
4
votes
2 answers

Stateless Sessions with Spring Security Saml and SP Application

I tried to run the boot sample spring security saml boot from, https://github.com/vdenotaris/spring-boot-security-saml-sample I am able to run it and integrate with identity provider. But, I see that a session is created every time and remains…
bstechie
  • 85
  • 1
  • 8
4
votes
2 answers

HttpSession setAttribute doesn't always insert new object

I am working on an upgrade from WLS10g and JavaEE6 to WLS12c and JavaEE7. I have noticed a difference on how HttpSession.setAttribute works. In WLS10, any object already stored under a certain key would always be replaced. In WLS12 the object is…
Klas Lindbäck
  • 33,105
  • 5
  • 57
  • 82
4
votes
2 answers

How to config spring-session to support HeaderHttpSessionStrategy and CookieHttpSessionStrategy in one application?

I have a project want to support android,ios,pc web. I try to use https://github.com/spring-projects/spring-session, can it be just config in an application to support HttpSession and rest token? if it can,how i can config it?
kalman
  • 41
  • 1
  • 5