Identifiying the calling page

J

Jon Hunt

Hi

I'm trying to do something simple: find out which page had the link
which got me to the current page. I am using window.referrer, in IE6,
but it never has anything but blank in it. The scenario is that the
user must go though a sign on page to get to the goodies. If they go
direct, they get bumped to login:


if (window.referrer != "login_page" { window.location.href =
"login_page" }

But the referrer is no present. I've also tried looking at
window.history but to no avail. Are these all netscape specific and if
so, what is an IE equivalent?

Jon Hunt
 
K

kaeli

Hi

I'm trying to do something simple: find out which page had the link
which got me to the current page. I am using window.referrer, in IE6,
but it never has anything but blank in it. The scenario is that the
user must go though a sign on page to get to the goodies. If they go
direct, they get bumped to login:

Referer is never a good thing for relying on, as you've noticed. Anyone
with a modicum of programming knowledge or script kiddie tools can spoof
it, too.

The normal way of doing logins is to have the user enter their username
and password in a form, then have the form POST to a page that checks
the login and password server-side. If it is correct, it sets a cookie
or session variable that all other pages that need to know that the user
has logged in can check.

If you don't need all that, just set a cookie on the login page and
check it on the next. This is insecure as hell. :)

--
--
~kaeli~
A little rudeness and disrespect can elevate a meaningless
interaction to a battle of wills and add drama to an
otherwise dull day.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top