/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Setting Cookie

Hello,

I’m getting this error:

[code]Warning: setcookie() expects parameter 3 to be long[/code]

The line its referring to is:

[code=php]setcookie(‘member_id’, $this->member[‘id’], “/”, ‘.mydomain.com’);[/code]

Any ideas? I’m trying to set the cookie for all subdomains.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 27.2007 — As per http://www.php.net/setcookie, the 3rd parameter is the expiration time, so you need to add a time between the member ID value and the "/".
Copy linkTweet thisAlerts:
@h3r0authorNov 27.2007 — Pff...I can't believe I forgot that. Honest mistake. Thanks NogDog.
×

Success!

Help @h3r0 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.29,
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,
)...