how to sign out of my application
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
iam using session.invalidate () for log out..
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
if you are using session.invalidate() it should work unless you are not checking the session on each jsp.
by hitting the back button only the the history of previous screen is displayed, if any operation is tried on the page then the page will return a invalid session and redirect you to a longin page if any.
See if you can delet the history when logging out..then there is no question of going to the previous page
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Amod Mulay:
hi
if you are using session.invalidate() it should work unless you are not checking the session on each jsp.
by hitting the back button only the the history of previous screen is displayed, if any operation is tried on the page then the page will return a invalid session and redirect you to a longin page if any.
See if you can delet the history when logging out..then there is no question of going to the previous page
yes i am using session.ivalidate() it is working but when i press back button on the browser button it shows the previous screen
instead of showing the last accessed page i want to display session expired messgae to the user
can u please can u suggest me how to delete the history?
thanx in advance

A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
<HEAD>
<script>
history.forward();
</script>
</Head>
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Alix Sye:
Put the following code between the <head> </head> in the page . it will not let you go back ever to the previous page. I put this code in my main_frame page where i display all my application pages.
<HEAD>
<script>
history.forward();
</script>
</Head>
ok thanx very very much for ur code..
but in my application some of my links are directly pointing to servlet and the servlet then forwards to jsp file..
so how can i restict here.. what should i write in the servlet .. can any one hlep me by providing some piece of code

A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
and how can i know the currently logged in users?
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by saikrishna cinux:
ok thanx very very much for ur code..
but in my application some of my links are directly pointing to servlet and the servlet then forwards to jsp file..
so how can i restict here.. what should i write in the servlet .. can any one hlep me by providing some piece of code
![]()
dude i think you are confusing yourself here .... there is no need to write such code in a servlet by hitting back button you are not doing to the servlet unless your form is automatically submitting it self on load
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by saikrishna cinux:
please sombody tell me how to develop the code for login and logout
and how can i know the currently logged in users?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by saikrishna cinux:
please sombody tell me how to develop the code for login and logout
and how can i know the currently logged in users?
for your currently logged in users declare a static variable in your login servlet ....and increment it evertime anyone accesses it....and in logout decrement it..
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
A more polished way of doing the same thing is if you are using Struts then in the Action servlet you can do this check if a session object is null or not, so you dont have to include anytihng in your JSPs, since all the requests go through this servlet
If anyone knows better approaches please let us know, since this is soething every web developer comes across
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
i am not using struts or any other fframe work..
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
| See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |









