S
Software Pulsar
I have two pages, called First and Second. I want to disallow
bookmarking my Second page. First page can be bookmarked if the user
wishes. User can reach both the pages by typing the URL. If the user
goes to the Second page from First page then Session information will
be maintained/communicated about the user to the server. Otherwise if
user goes directly to the Second page by bookmarking it at an earlier
time, then in Server, User information cannot be maintained.
And moreover First page is like Login page I can say, but exactly not
Login page. If the user reaches Second page via the button available
in First page then only we can keep track of the User. First Page can
be reached by typing URL or bookmarking.
I used the following code in java file.
String refererPath = request.getHeader("referer");
// Dont allow the user to see the bookmarked web page.
if (refererPath == null) {
setContent(gen_error .....".CANT-BOOKMARK")));
return null;
}
Actually, The code I have typed works fine with Firefox browser, But
it is not working in IE browser, as IE does not support this 'referer'
in the HTTP header(I don't know it exactly).
If any alternative for this 'referer' is available in IE means I can
implement the If condition, so that I can check whether the browser is
IE or FF and implement the logic accordingly. The thing is IE does not
support this 'referer', and it always returns null value. Where as the
Firefox returns null if the page comes via bookmarking otherwise some
value if it comes from First page.
I need solution for this bookmarking such that it works in both the
browsers,
Is it possible to disallow the user bookmarking a page then it is also
useful to me, so that I can implement that. My ultimate aim is to
prevent user from Bookmarking my Second page. Or even if User
bookmarked it then disallow user to access that page.
Please help me out in this situation. Thanks in advance.
bookmarking my Second page. First page can be bookmarked if the user
wishes. User can reach both the pages by typing the URL. If the user
goes to the Second page from First page then Session information will
be maintained/communicated about the user to the server. Otherwise if
user goes directly to the Second page by bookmarking it at an earlier
time, then in Server, User information cannot be maintained.
And moreover First page is like Login page I can say, but exactly not
Login page. If the user reaches Second page via the button available
in First page then only we can keep track of the User. First Page can
be reached by typing URL or bookmarking.
I used the following code in java file.
String refererPath = request.getHeader("referer");
// Dont allow the user to see the bookmarked web page.
if (refererPath == null) {
setContent(gen_error .....".CANT-BOOKMARK")));
return null;
}
Actually, The code I have typed works fine with Firefox browser, But
it is not working in IE browser, as IE does not support this 'referer'
in the HTTP header(I don't know it exactly).
If any alternative for this 'referer' is available in IE means I can
implement the If condition, so that I can check whether the browser is
IE or FF and implement the logic accordingly. The thing is IE does not
support this 'referer', and it always returns null value. Where as the
Firefox returns null if the page comes via bookmarking otherwise some
value if it comes from First page.
I need solution for this bookmarking such that it works in both the
browsers,
Is it possible to disallow the user bookmarking a page then it is also
useful to me, so that I can implement that. My ultimate aim is to
prevent user from Bookmarking my Second page. Or even if User
bookmarked it then disallow user to access that page.
Please help me out in this situation. Thanks in advance.