Redirecting after session expires

Advertisement
November 30

Hi
i have a user session object which implements HttpSessionBindingListener.
what i would like it to do is when the unBound method is triggered, i want it to be directed to a logoff page. This process was created to automatically log off the users which closed down their browsers.
However, when the session expires and this object is unBound, i have not been able to find a way to get it to redirect ot the logoff page.
is there any way to do this??
Or possibly some other way of listening for the session expiration and to redirect to the logoff page??
Here is the code of the session object.
public class UserSession implements HttpSessionBindingListener{  
private String userid;
public String getUserid(){
return userid;
public void setUserid(String value){
userid = value;
public void valueBound(HttpSessionBindingEvent event)
public void valueUnbound(HttpSessionBindingEvent event)
RequestDispatcher rd = request.getRequestDispatcher("logoff");
rd.forward(request, response);
}

Advertisement

Replay

Hi,
The object that is in session and implementing HttpSessionBindingListener can only be existing with in HttpSession boundary, and There would be only one response if there is a request(Http primary rule),
As I have been using this(servlet 2.3) kind of approach in my work, I can assure that there is no chance of sending/redirecting a page to browser in this scene.
Let's think in this way..
Session will be expired in the web server only and only Servletcontext/webserver knows when it is going to be expired.. to send a page u need request( request.getRequestDispatcher("")..) object or response ( response.sendRedirect("")) objects.. So how would we get these objects in the session.
and as HTTP follows the stateless behaviour, Server would never know whom it should send page. unless there( in server) is some one (request) waiting to recieve this response..
For your question. I can suggest use page refresh meta tag that would call MyLogout.java(servlet) when certan time( 5 min) expires that means user is inactive with the application...
Hope this can help you..
cheers....

View 8 Replies

HttpSessionListener.sessionDestroyed is called after session expired

November 30

Hi I implemented HttpSessionListener as I need to save some data from the session when it is timed out. The javadoc say: " Notification that a session is about to be invalidated. " I understand from this that the session is still there when sess

View All Replies

How to disable  browser back button after session logout..

November 30

Hi; I want to restrict the user to use the back button after session expired or logout. By doing the session expired we are restricting the user to do any new work but I want to restrict the user to see the back pages that he surfed previously in the

View All Replies

After Proliant restart ilo session expired (HP ML150 gen9)

November 30

After the restart the hp Proliant ml150 g9 server the connection to ilo(v2.03) is automatically disconnected. (message:session expired). How can i configure the server that you are not automatically logged out? thx for help (sorry for my bad englisch

View All Replies

SJSAS 9 and JSF - session expiration

November 30

Hi I'm developing JSF (1.2) application. I'm using SJSAS 9, EJB 3.0 and toplink. My problem is session expiration. When user session expires and then user click for example on Save button on JSF form, application goes to login page, but after login u

View All Replies

Session expires and forwarding emails to recipi...

November 30

Hi  It  seems  similar  problems  are happening. Composing  an  email  appears  to  function ok  albeit  you  can  see the  screen wanting  to  disappear,but  it  sends ok. With  regards to  incoming   emails which  you  wish  to  redirect  to  recip

View All Replies

Session expire too quickly

November 30

Hello, I am using BC on a site bt the session expire very quickly. i think its cookie because when i hit save after filling items it take me to login screen. can i extend the time of user logged in?Hi If you are referring to secure zone expiry then u

View All Replies

No more than 1 sessions at a time are allowed. Please wait until open sessions expire.

October 11

I have been unable to log into my Actiontec MI424WR router this week, The router returns the message "No more than 1 sessions at a time are allowed. Please wait until open sessions expire." every time I try to log in. This has been going on for

View All Replies

Session expired - sitzungszeit abgelaufen

November 30

I have now a new ipad mini. After setup I want to download some Apps. But I can´t buy some apps with my Itunes account. (Need to change credit card  details). Seconds upon registering I get the message "session expired". It comes again and again

View All Replies

Session Expired Error in Oracle Vision Demo due to absence of a cookie !!

November 30

Hi Folks, I kept getting the session expired error in Vision Demo even after I had supplied the right user id/password combos. So I set up a on-logon trigger in the APPS schema and it turns out that the Front End JSP page calls the ICX_SEC package. H

View All Replies

How to forward automatically when session expires ?

November 30

Hi Techies, whenever session expires , I want my struts action to forward to logout page automatically. I know we can do it by implementing sessionlistener(session destroyed method). But how to forward using action mapping . any solution is appreciat

View All Replies

Before session expires event

November 30

I need to know if there is any kind of way to fetch an event before the session expires. I know there is HttpSessionBindingListener, but this only gives me the event after the session expired. I need an event before it expires because I have to clean

View All Replies

ISE 1.2 CWA with Multiple PSNs - SessionID Replication / Session Expired

October 11

Hi all. I have a (2) Policy Services Nodes (PSNs) in an ISE 1.2 deployment running patch 1. We are using Wireless MAB and CWA on 5760 Wireless LAN Controllers running v3.3.3. We are hitting an issue wherein a client first passes MAB and then gets red

View All Replies

Session expired,please log in again?!

November 30

Hello there to everybody I have an annoying problem with my iphone... Every time i try to long into facebook from my iphone,its keep saying session expired,please log in again,and i try,but i can`t,keep getting the same message.and i try to log in fr

View All Replies

Disco 3i - Session Expired?

November 30

I have just installed the Discoverer 3i on NT 4.0 Service pack 5, running OAS 4.0.8.1. (Oracle 8iEE is on a different server, I have verified TNS and connectivity) The install went smoothly, and I get the signon screen fine, however when I go to sign

View All Replies

Determining when session expires

November 30

I want to be able to track the amount of time that the user spends on my site. I am going to insert a record into a database when the user logs on. I also want to insert a record when the user's session expires either from timing out or closing the b

View All Replies

When does a session expire

November 30

Hello, I have experienced that the calendar 5.1.1 session will not die. I have checked the documentation and looked through the ics.conf, without success. Any suggestions? Thanks in advance, Robertoics.conf file should contain all the configuration i

View All Replies

Session Expired - SessionManager Problem?

November 30

This is a OAS4.0.8.1 problem. Session Expired message comes when the cartridge times out and exited. However, my servlet have no means to process this exception. By enabling the logging, the problems seems to be from oracle.oas.session.SessionManager

View All Replies

Is it possible to auto delete directory when the session expires?

November 30

I create a directory for each session based on the unique session id e.g. c:\website\8D143E46EA18FAEFEF4D807180A307E2 Is it possible to auto delete this directory when the session expires?thanks i found this great link which teach how to use HttpSess

View All Replies

Hi, I cant login to the facebook app on my iphone 5 ios 6.0.2.  I keep getting an error message saying 'There was an error logging in using single sign on' when im asked to log in again i get a 'session expired' message.  This only started happening yeste

October 11

Hi, I cant login to the facebook app on my iphone 5 ios 6.0.2.  I keep getting an error message saying 'There was an error logging in using single sign on' when im asked to log in again i get a 'session expired' message.  This only started happening

View All Replies

Tags:

  1. ipad A 1460 is disabled itunes
  2. windonw 8 graphics card dw
  3. hp 2560p restarts after shutdown
  4. iphoto 8.1.2 hanging delete plist
  5. screen exist used in ml81n
  6. KE30 and SAP
  7. rfbibl00 newko
  8. elitepad 900 shutsdown
  9. 30LF
  10. thumb4nm
Copyrights 2019 Fcffair BigData Resource, All rights reserved