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

Multiple HTTP Session created

Some customers are reporting a issue of multiple http sessions created in Internet Explorer 6 and 8. But this is not observed when using firefox/chrome. This issue occurs randomly also. Also we do not see the same in our systems using version IE…
Karthik K N
  • 71
  • 3
  • 7
2
votes
2 answers

How to change JSESSIONID in Struts 2

I should assign unique JSESSIONID after authentication. The JSESSIONID before authentication and after authentication should always be different. So, how can I do this using Struts 2?
user2221047
2
votes
1 answer

HttpContext.Current.Session equivalent in Spring MVC

I'm an asp.net developer and I'm now working on a Spring MVC webproject. I want to write a helper class that allows me to get the current User or check if a user is logged in, something like that. In asp.net I could create a class anywhere in my…
d03090
  • 354
  • 1
  • 5
  • 17
2
votes
1 answer

Get the last accessed time a client sends a request using the same session in jsf?

I am currently using FacesContext.getCurrentInstance().getExternalContext().getSessionMap() ,is there any way i can get the last accessed time a client makes request associated with the same session, just like Session.getLastAccessedTime() ? As of…
ayampenyet
  • 241
  • 1
  • 2
  • 15
2
votes
0 answers

Struts2 - session is lost after a redirect

I'm working on a Java EE web application based on Struts2(say CNG). At a particular point, the user is redirected to a Payment Gateway (say IM.com) and then IM redirects to an Action of CNG. An interceptor runs before every Action checking for the…
Saturnian
  • 1,686
  • 6
  • 39
  • 65
2
votes
3 answers

Retrieve browser locale from httpsession?

Is it possible to derive the preferred language from a httpsession object (javax.servlet.http.HttpSession) ? It is possible to get it from the servletrequest but I dont have that. Thanks for any ideas. Sven
javadude
  • 1,763
  • 1
  • 19
  • 38
2
votes
4 answers

PHP's real SESSION object

EDIT: (UPDATED) Maybe my question was not clear enough. Ok, lets put it this way: $arr["a"] = 10; var_dump($arr); $arr["b"] =& $arr["a"]; var_dump($arr); the first var_dump returns: array 'a' => int 10 While the second one returns: array 'a'…
lepe
  • 24,677
  • 9
  • 99
  • 108
2
votes
1 answer

Grails Asynchronous Request with HttpSession behaves strangely

I have a simple controller with an action for a long running task and an action for checking a status of the long task: class AsyncController { def index() { } def longTerm() { session.longTerm = 0 session.longTermDone =…
machaj
  • 288
  • 2
  • 7
2
votes
2 answers

My session not became Null after invalidating the session

Hi Can anyone plz let me know what would be the problem in the following code.In this below code I have invalidated my session after creating the new session by using the http session.getsession(true) and setting the attribute also.Once I click the…
user3214269
  • 219
  • 2
  • 8
  • 23
2
votes
0 answers

Test with HttpSession attributes set and get is null

im doing test for one method with junit and mockito. I want to test if a .setatribute in httpsession is ok. This is my code: @Test @PrepareForTest({PortalUtil.class}) public void changeStagingSourceUrlValueLive(){ ActionRequest request =…
colymore
  • 11,776
  • 13
  • 48
  • 90
2
votes
1 answer

session listener - valueBound or valueUnbound doesn't called

I've just tried to add session listeners in my test web app the HttpSessionBindingListener and HttpSessionAttributeListener ones; They both implemented into my test object as : public class MySessionListener implements…
user592704
  • 3,674
  • 11
  • 70
  • 107
2
votes
1 answer

HTTP Session Replication in JBoss EAP 6.1

I am trying to get my JSF Web Application deployed in a "domain" cluster with two nodes. I am unable to get the HTTP Session replicated between the nodes. I have configured my web.xml
Koekiebox
  • 5,793
  • 14
  • 53
  • 88
2
votes
5 answers

Set session attribute using javascript

I'm using jqueryui autocomplete combobox in my jsp page. I need to set selected value of combo-box to the HttpSession. I tried as below. this._on(this.input, { autocompleteselect: function (event, ui) { // alert(ui.item.value); …
Bishan
  • 15,211
  • 52
  • 164
  • 258
2
votes
2 answers

How to set the values in session?

If I'm getting empty session I need to setup some values to play the action class. So, here is the method public SearchFilters getFilters() { return (SearchFilters) getSession().get("Filters"); } I would like to check the session, if it's null,…
user2444474
  • 623
  • 8
  • 21
  • 40
2
votes
2 answers

Check my code, I‘m using ThreadLocal to manage HttpSession

I'm use ThreadLocal to manage HttpSession. code as below: public class HttpSessionLocal { private static ThreadLocal threadLocal = new ThreadLocal(); public static HttpSession getSession(HttpServletRequest…
albert
  • 27
  • 7