/    Sign up×
Community /Pin to ProfileBookmark

Problem with Cookies

I have a php app that is to set/update a cookie.
I am using
[B]setcookie(“hdclimit”, $_GET[‘CLIMIT’], time() + (3600 * 24 * 364) + 5,”/”, “.v4.dir.com”);
to set the cookie.
[/B]

and then
[B]if (isset($_
COOKIE[hdclimit]))
{ print(“cookie has been set<br>”);
$default_climiter = $_COOKIE[hdclimit];
}
else { print(“The cookie wasn’t set”);$default_climiter = “10”;}[/B]

to determine whether or not the cookie has been set.

The first time I enter the web page, I receive the not set message and upon exiting I can find the cookie file in the C:Documents and SettingsusernameCookies directory.

The second time I enter the web page, I receive the cookie found message and the cookie value is used.

When I exit from the web page, the cookie is gone from the C:Documents and SettingsusernameCookies directory.

The 3rd time I enter the web page, I again receive the cookie not found message.

What causes this cookie to disappear on me. Is it not just supposed to update?

TIA
D

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @moohuey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...