Back button detection 
Author Message
 Back button detection

how can I detect on the server if a page was loaded because the Back browser
button was pressed?

I tried this
HTTP_REFERER=
<%=Request.ServerVariables("HTTP_REFERER") & Time()%>

however this server side script does not get triggered if the user clicks on
the Back button.



Sun, 02 Jun 2002 03:00:00 GMT  
 Back button detection

Quote:
>how can I detect on the server if a page was loaded because the Back browser
>button was pressed?
>...
>however this server side script does not get triggered if the user clicks on
>the Back button.

I don't think there is a general way to detect the "back button",
since that's part of the browser, not of the HTML document.
For instance, with IE5, when you press Back, it generally does not
request the server, but read the page in its cache.

Here, we have looked for a solution to this problem for a long time,
and I don't think there is a solution that works with any browsers.
(IE5 behaviour is different of IE4 behaviour and different of Netscape
behaviour...)

Jerome.

---
Jerome Siour

Office:

Home:

 http://www.multimania.com/jsiour



Mon, 03 Jun 2002 03:00:00 GMT  
 Back button detection
this is what I have noticed during my tests.
the page is loaded from the cache and no scripts are executed
on the page (therefore no detection can be made in the page itself)
I wonder how is this possible.


Quote:
> >how can I detect on the server if a page was loaded because the Back
browser
> >button was pressed?
> >...
> >however this server side script does not get triggered if the user clicks
on
> >the Back button.

> I don't think there is a general way to detect the "back button",
> since that's part of the browser, not of the HTML document.
> For instance, with IE5, when you press Back, it generally does not
> request the server, but read the page in its cache.

> Here, we have looked for a solution to this problem for a long time,
> and I don't think there is a solution that works with any browsers.
> (IE5 behaviour is different of IE4 behaviour and different of Netscape
> behaviour...)

> Jerome.

> ---
> Jerome Siour

> Office:

> Home:

>  http://www.multimania.com/jsiour



Mon, 03 Jun 2002 03:00:00 GMT  
 Back button detection
Why not try putting your own 'back' button on your pages, that way you can
capture the click.  It will not capture 100% of the 'back' requests, but you
can hopefully capture many of them.

www.askasp.com

Quote:

> this is what I have noticed during my tests.
> the page is loaded from the cache and no scripts are executed
> on the page (therefore no detection can be made in the page itself)
> I wonder how is this possible.



> > >how can I detect on the server if a page was loaded because the Back
> browser
> > >button was pressed?
> > >...
> > >however this server side script does not get triggered if the user
clicks
> on
> > >the Back button.

> > I don't think there is a general way to detect the "back button",
> > since that's part of the browser, not of the HTML document.
> > For instance, with IE5, when you press Back, it generally does not
> > request the server, but read the page in its cache.

> > Here, we have looked for a solution to this problem for a long time,
> > and I don't think there is a solution that works with any browsers.
> > (IE5 behaviour is different of IE4 behaviour and different of Netscape
> > behaviour...)

> > Jerome.

> > ---
> > Jerome Siour

> > Office:

> > Home:

> >  http://www.multimania.com/jsiour



Mon, 03 Jun 2002 03:00:00 GMT  
 Back button detection
Try this

<body onclose="variables=window.open('variables.htm','vars',width=1
height=1);variables.backButtonPressed.value=1">

on previous page

<script>
backButtonPressed=vars.backButtonPressed.value
</script>

variables.htm
<input name="backButtonPressed" value="0"></input>

Greg


Quote:
> >how can I detect on the server if a page was loaded because the Back
browser
> >button was pressed?
> >...
> >however this server side script does not get triggered if the user clicks
on
> >the Back button.

> I don't think there is a general way to detect the "back button",
> since that's part of the browser, not of the HTML document.
> For instance, with IE5, when you press Back, it generally does not
> request the server, but read the page in its cache.

> Here, we have looked for a solution to this problem for a long time,
> and I don't think there is a solution that works with any browsers.
> (IE5 behaviour is different of IE4 behaviour and different of Netscape
> behaviour...)

> Jerome.

> ---
> Jerome Siour

> Office:

> Home:

>  http://www.multimania.com/jsiour



Mon, 03 Jun 2002 03:00:00 GMT  
 Back button detection
the problem is hitting back accesses the cache
fortunately there's a way around that

at top of your .asp file
<%    response.buffer = true    %>
at the bottom
<%    response.expires = 0    %>
--David J.


Quote:
> how can I detect on the server if a page was loaded because the Back
browser
> button was pressed?

> I tried this
> HTTP_REFERER=
> <%=Request.ServerVariables("HTTP_REFERER") & Time()%>

> however this server side script does not get triggered if the user clicks
on
> the Back button.



Mon, 10 Jun 2002 03:00:00 GMT  
 Back button detection
Hi!

The text below is taken "as is" from RFC2068:
   History mechanisms and caches are different. In particular history
   mechanisms SHOULD NOT try to show a semantically transparent view of
   the current state of a resource. Rather, a history mechanism is meant
   to show exactly what the user saw at the time when the resource was
   retrieved.

   By default, an expiration time does not apply to history mechanisms.
   If the entity is still in storage, a history mechanism should display
   it even if the entity has expired, unless the user has specifically
   configured the agent to refresh expired history documents.

So (IMHO) there is no universal workaround for Back button behaviour unless
you develop an intranet application - usually in such case it may de defined
restricted environment (browsers, servers, etc.) and settings for it.

Alexandr Alexeev



Quote:
> the problem is hitting back accesses the cache
> fortunately there's a way around that

> at top of your .asp file
> <%    response.buffer = true    %>
> at the bottom
> <%    response.expires = 0    %>
> --David J.



> > how can I detect on the server if a page was loaded because the Back
> browser
> > button was pressed?

> > I tried this
> > HTTP_REFERER=
> > <%=Request.ServerVariables("HTTP_REFERER") & Time()%>

> > however this server side script does not get triggered if the user
clicks
> on
> > the Back button.



Tue, 11 Jun 2002 03:00:00 GMT  
 Back button detection
using the following can prevent additions to the history and so no back is
possible

<A HREF="javascript:location.replace('http://address/etc')" > whatever </A>

however this can't be used in all situations (e.g I believe it won't work
for redirections or form posts) but it can be useful to limit history use


Quote:
> how can I detect on the server if a page was loaded because the Back
browser
> button was pressed?

> I tried this
> HTTP_REFERER=
> <%=Request.ServerVariables("HTTP_REFERER") & Time()%>

> however this server side script does not get triggered if the user clicks
on
> the Back button.



Fri, 16 Aug 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Back button detection

2. IE Back Button vs window.history.back()

3. Link back from a URL without pressing BACK button

4. Link back from a URL without pressing BACK button

5. Detection of a pressed command button

6. Detection of a pressed command button

7. button detection while minimized

8. Mouse Button Detection

9. Disabling "BACK"/"FORWARD" buttons

10. Disabling Back Button on Browser

11. Disabling Back Button on Browser

12. disable browser back button

 

 
Powered by phpBB® Forum Software