Jump to content

[SOLVED] setcookie()...on fire!


cmgmyr

Recommended Posts

Ok...this I don't get...

 

I have:

if (isset($remember)){
				setcookie("user","$info",time()+1209600);
			}else{
				setcookie("user","$info",0);
			}

 

I can echo $info and it looks fine, but when i echo the cookie...nothing.

 

I have this in 2 sites on my local computer...one works...one doesn't. I don't know why it's not setting the cookie. (it's going to the else statement) any ideas?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/43914-solved-setcookieon-fire/
Share on other sites

I'm on a different computer now but now I'm getting this...

 

Line 59 is: setcookie("user","$info",0);

 

delete cookie

Warning: Cannot modify header information - headers already sent by (output started at C:\web\www\htdocs\tarson\header.php:8) in C:\web\www\htdocs\tarson\includes\do_login.php on line 59

ok ok sorry I found it...

 

When I made my new config file I for got to copy:

<?php 
$phpver = phpversion();
if ($phpver < '4.1.0') {
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_SERVER = $HTTP_SERVER_VARS;
}
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
if (extension_loaded('zlib')) {
	ob_end_clean();
	ob_start('ob_gzhandler');
}
} else if ($phpver > '4.0') {
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
	if (extension_loaded('zlib')) {
		$do_gzip_compress = TRUE;
		ob_start(array('ob_gzhandler',5));
		ob_implicit_flush(0);
	}
}
}
$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
$PHP_SELF = $_SERVER['PHP_SELF'];
}

if (!ini_get("register_globals")) {
import_request_variables('GPC');
}
?>

 

now it works like a charm!

 

Thanks for all the help guys! The moral of the story...copy your WHOLE config file... ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.