Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Browser Back Button Date: Tue, 10 Jan 2017 19:49:22 -0500 Organization: Aioe.org NNTP Server Lines: 36 Message-ID: References: <9fc9d84a-b4a7-45a6-a47a-ab7d885bf5ce@googlegroups.com> <0dec1ad1-3625-4ac6-91aa-9b176256554b@googlegroups.com> NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:36183 On 1/10/2017 6:29 PM, Davej wrote: > On Sunday, January 8, 2017 at 7:20:29 PM UTC-6, Arne Vajhøj wrote: >> On 1/8/2017 7:30 PM, Arne Vajhøj wrote: >>> On 1/8/2017 6:41 PM, Davej wrote: >>>> The problem is that if I immediately log out after logging in >>>> and then use the browser BACK button the browser will resend >>>> the username and password parameters and log me back in again. >>>> I guess this is just an odd little quirk, but is there perhaps >>>> an easy way to prevent this? >>> >>> I don't think there is anything servlet/JSP specific in the >>> problem. >>> >>> Long time since I have worked with stuff like this, but I believe >>> one way of handling it is to redirect instead of forward. >> >> And to avoid any doubt. LoginServlet redirect instead >> of forward to Membership.jsp. >> > > I'm having a problem using a redirect because I'm using a filter, and > the filter doesn't seem to like that. I end up with a 500 error. > > One solution seems to be to invalidate the session upon a successful > login and create a new session for the session member object. Or you could troubleshoot that filter problem. There must be a reason and a solution to that problem. I would not like to run with a filter that barfs on redirects. Arne