addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Seattle PHP User Group Message Board › Cookie Problems - setcookie won't set 'Path'

Cookie Problems - setcookie won't set 'Path'

Stephen M.
Seattle, WA
Post #: 6
Hello Seattle PHP Friends,

I am trying to set a cookie on my site. Everything works until I try and set a path. When I set a path it stops updating on refresh.

My objective is to store the referral ID (passed through URL in 'refid' variable).

$expire = time()+60*60*24*30;
$refID = $_GET['refid'];
$url = site_url();
setcookie('referral', $refID, $expire, '/', $url);

Everything is passing except the path. I have tried changing the '/' to "/" and "/jobs/"... No dice.

Your help would be greatly appreciated.
David M.
Littleton, CO
Post #: 26
Hello Stephen,

We normally discuss questions like this on the Mailing List (not here on the Message Boards). If you don't mind, perhaps you can re-send this question to the email list instead?

The Message Boards are mainly used for Job Postings, just so you know.

David Malouf
Stephen M.
Seattle, WA
Post #: 8
Thanks David. I got an answer for this, but I will be sure to email next time.
Powered by mvnForum

Our Sponsors

  • PluralSight

    PluralSight subscriptions for developer training

  • O'Reilly

    Disc Code: PCBW is good for 40% off print and 50% off ebooks and videos

  • JetBrains PhpStorm

    Occasional free licenses to raffle off at meetups

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy