| | |
How to logout!!!
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Java Syntax (Toggle Plain Text)
public class logout extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { process(request,response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { process(request,response); } public void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); session.invalidate(); response.sendRedirect("index.jsp"); } }
session is still alive!!!
Last edited by peter_budo; May 9th, 2008 at 7:04 pm. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: May 2008
Posts: 1
Reputation:
Solved Threads: 1
well u could logout by using these methods
1) using the session.invalidate();
2) restricting the user from using the login details (when using the back button) by refreshing the page.
3) Using the sessionAccessTime.........
The first method does get you out of the session ............
provided you have used the session='true' [for jsp pages]
or HttpSession s=request.getSession(true) [in servlet this code works in the jsp in <% %>tag]
in the first page and using false in the rest of the pages as it wont create the new sessions..................
but this method is ineffective as the browser has a back button.................
if you want to know more about doing a proper logout you can write to me
1) using the session.invalidate();
2) restricting the user from using the login details (when using the back button) by refreshing the page.
3) Using the sessionAccessTime.........
The first method does get you out of the session ............
provided you have used the session='true' [for jsp pages]
or HttpSession s=request.getSession(true) [in servlet this code works in the jsp in <% %>tag]
in the first page and using false in the rest of the pages as it wont create the new sessions..................
but this method is ineffective as the browser has a back button.................
if you want to know more about doing a proper logout you can write to me
•
•
Join Date: Apr 2009
Posts: 1
Reputation:
Solved Threads: 1
•
•
•
•
well u could logout by using these methods
1) using the session.invalidate();
2) restricting the user from using the login details (when using the back button) by refreshing the page.
3) Using the sessionAccessTime.........
The first method does get you out of the session ............
provided you have used the session='true' [for jsp pages]
or HttpSession s=request.getSession(true) [in servlet this code works in the jsp in <% %>tag]
in the first page and using false in the rest of the pages as it wont create the new sessions..................
but this method is ineffective as the browser has a back button.................
if you want to know more about doing a proper logout you can write to me
I had read what you have discussed here. I am facing same problem what you had. If any suggestion or help that will be appreciated.
•
•
•
•
I had read what you have discussed here. I am facing same problem what you had. If any suggestion or help that will be appreciated.
JSP Syntax (Toggle Plain Text)
is to session.setAttribute(null,"sessionname");
![]() |
Similar Threads
- logout problem (JSP)
- Another Logout Link (DaniWeb Community Feedback)
- Creating a Robust Logout System (Perl)
- How I can deactivate backward option in jsp web pagewhen I logout as a user (JSP)
- logout problem after sessionivalidate (JSP)
Other Threads in the JSP Forum
- Previous Thread: java servlets help???
- Next Thread: code required
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






