Hi all,
I want my users to HAVE to rely on cookies for my sessions. It's not too much to ask and it gives me a warm fuzzy feeling to know that my data is a bit safer.. Anyway, I could use a little help with what might be a very simple dilema. I want to check that a user has cookies enabled and if not, be able to notify them that they must. I could use a redirect trick after setting a cookie and then looking for that cookie on the next page, but that seems so amateurish. Maybe a little javascript or something a bit more elegant would do the trick.
thanks for the help.
-heyrad
Make 'em eat cookies!
Moderator: General Moderators
- trollll
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 10, 2003 11:56 pm
- Location: Round Rock, TX
- Contact:
Javascript holds the key.
A simple javascript can detect it (I think) across the board for browsers and platforms.
Hope that help! 
Code: Select all
<script type="text/javascript">
if (document.cookie) {
document.location.replace("realsite.php");
} else {
document.write("If you don't accept cookies, you don't use this site.");
}
</script>