GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   how to verify if session cookies are enabled with PHP (https://gfy.com/showthread.php?t=93287)

magnatique 12-11-2002 03:18 PM

how to verify if session cookies are enabled with PHP
 
is there any way I can verify if session cookies are enabled on a user's browser?

LUCL0NELY 12-11-2002 03:36 PM

yes

magnatique 12-11-2002 04:23 PM

now that's helpful

Lane 12-11-2002 04:25 PM

probably not with a single http request
try to set it in the first request, then try to read it in the second one

Rory 12-11-2002 06:25 PM

Quote:

Originally posted by magnatique
is there any way I can verify if session cookies are enabled on a user's browser?
Do this :

PHP Code:

<?php
$ref 
$_SERVER['PHP_SELF'];
setcookie("test","working");
header ("Location: http://www.yourserver.com/verify_cookies.php?ref=$ref");
exit;
?>

Paste that anytime you wanna verify if cokkies are enabled.

Then save this as a file named verify_cookies.php :

PHP Code:

<?php
$ref 
$_GET['ref'];
$test_cookie $_COOKIE['test'];

if (
$test_cookie == "working") {
header ("Location: http://www.yourserver.com/$ref");
} else {
header ("Location: http://www.yourserver.com/youaintgotnocookies.php");
}
exit;
?>

Make modifications where needed.

Rory
:helpme

Edit: Parse URLs doesnt work too well in code

Backov 12-11-2002 07:01 PM

Very easy (you should have just asked me again Mag)

You don't have to. Ignore the code above, again.

Do this:

echo "&lt;a href='blah.php?'" .SID. "&gt;";

SID is the session ID, and it will only be appended if it's needed (ie, user doesn't have cookies enabled.) Remember, it's not $SID - it's SID.

Cheers,
Backov

Rory 12-11-2002 07:56 PM

Quote:

Originally posted by Backov
Very easy (you should have just asked me again Mag)

You don't have to. Ignore the code above, again.

Do this:

echo "&lt;a href='blah.php?'" .SID. "&gt;";

SID is the session ID, and it will only be appended if it's needed (ie, user doesn't have cookies enabled.) Remember, it's not $SID - it's SID.

Cheers,
Backov

Sorry didnt mean to confuse anyone. I misread his post and didnt see the session part before cookie. As Backov said you shouldnt rely on cookies when tracking sessions anyhow ... especially with a built in constant. Above would be how to detect if the user has cookies enabled or not however :1orglaugh

Rory

madness 12-11-2002 09:05 PM

Is this really who I think it is? Magnatique aka Phillip aka the cute guy who never replied my emails or returned my phone calls last year? :mad: You, my man, need some serious spankings!

magnatique 12-12-2002 11:43 AM

Backov, didn't want to disturb you on your birthday hehe..

will get back to ya today though ;)

----

madness, are you the lady formerly known as pam?
if so I never got any calls from ya lady :P

and you were the one ignoring my emails if I remmember lol... something about I'm out of the biz hehe

madness 12-12-2002 06:11 PM

Yep! That's me. I'd have to get the emails first in order to ignore :p Anyways, I called you to the California number you emailed me and left messages on an answering machine.. a while ago when I still used to be single lol. Yeah.. got married in August :)

You are right I quit on this bus in Jan but I still help out training newbie affiliates of ToyTeen with promotion and stuff in my spare time :glugglug Btw, your galleries look good you know where :thumbsup


All times are GMT -7. The time now is 04:40 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123