Jump to content

Cookies being remade with different paths.


iarp

Recommended Posts

<?php
if(!isset($_COOKIE['cms_theme'])) {
	$r = $cms->cquery('theme');
	setcookie('cms_theme', $r);
	$url = $_SERVER['REQUEST_URI'];
	header("Location: $url");
} elseif (isset($_GET['theme'])) {
	$get = escape_data($_GET['theme']);
	setcookie('cms_theme', $get);
	$url = $parts[0]; //$parts[0] = everything before the ?
	header("Location: $url");
}
?>

 

Problem, whenever i view example.com and then view example.com/programs/ i keep getting more cookies made. Ive installed an addon in FF so i can see what cookies are related to the website i'm working on and it's path shows / and the others /programs/.

 

How is a path set for a cookie so that no matter where the cookie is called wether it be / or /programs/ or /gui/ it's always the same one.

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.