File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

back button in mozilla

 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey freinds i am working on jsp

on logout my back button doesnot work its working perfectly allright means session expire but in mozilla firefox its not working it goes back & need not expires

please help me

thank you
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this helps

http://www.coderanch.com/t/291562/JSP/java/session-invalidate
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

for your reply & immidiate concern but i am facing problem in mozilla & also the post link you have sent is not sufficient sorry for this but guide me further

please

thank you
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show the code of logout, and how you are checking the session in the other page?
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually that is being done through struts

& i am not maintaing sessions if you still said me tpo post the code i can

thank you
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not very thorough with struts, but there must be some way to maintain session in struts as well.
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes there is a way but i am not using sessions in any of my fom so that i need to invalidate them there can be any other way to solve this porblem

thank you
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may be wrong, but I don't think without maintaining a session, the login/logout problem can be handled.
 
Raghu Chary
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
include this one befor logout page
<script type="text/javascript">
window.history.forward();
function noBack(){ window.history.forward(); }
</script>


and this one in logout jsp



<HEAD>

<script type="text/javascript">
window.history.forward();
function noBack(){ window.history.forward(); }
</script>
</HEAD>
<BODY onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">





</p>
</BODY>
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply raghu but i am not using any logout.jsp
But i will surely try your first code which i have to includein my jsp's b4 logout

thank you
 
Prasad Krishnegowda
Ranch Hand
Posts: 665
4
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have invalidated the session once the user logs out, and even still you see the page when you press back button, it is most likely a cached page shown by the browser.. You can change this behaviour by adding the following code to your jsp..
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanku so much Prasad Krishnegowda fro your reply but i have already added these lines on my page

Actually this code works allright for Internet Explorer but for Mozilla it does not work

thank you
 
Prasad Krishnegowda
Ranch Hand
Posts: 665
4
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aditi,
I remember there was a bug in firefox not recognizing no-cache tag..
What version of firefox you are using?
Also see this link http://www.coderanch.com/t/283182/JSP/java/prevent-caching. It may help you
 
Raghu Chary
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<HEAD>

<script type="text/javascript">
window.history.forward();
function noBack(){ window.history.forward(); }
</script>
</HEAD>
<BODY onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">



just place this code in logout. jsp and there use send Redirect method in the logout.jsp to redirect to your login page that will solve all the problems
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey Prasad Krishnegowda

thanks for the reply i tried it but also doesnot work by page is still going back after loggingout in Mozilla

help me please

thank you
 
Aditi agarwal
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys its been solved

for references i am copying the single line here else whole code remains same as my previous one

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic