logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$10
Problem setting cookie on WP Questions

Once again I'm using this site to ask a question, not about WordPress, but about WP Questions itself.

If you go to this page, a cookie should be set on your browser:

http://www.wpquestions.com/page/static/name/About

However, it seems to me that no cookie is being set. Here is the code I'm using, does anyone see a flaw in the way I'm setting this cookie?


public function executeStatic($request)
{
setcookie ("haveYouSeenTheLandingPage", $request->getParameter('name'), time() + 100000000);


if (file_exists($this->userCustomizationPath . 'templates/static' . $request->getParameter('name') . '.php')) {
$fileAsString = file_get_contents($this->userCustomizationPath . 'templates/static' . $request->getParameter('name') . '.php');
} elseif (file_exists(sfConfig::get('sf_root_dir') . '/apps/contest/modules/page/templates/static' . $request->getParameter('name') . '.php')) {
$fileAsString = file_get_contents(sfConfig::get('sf_root_dir') . '/apps/contest/modules/page/templates/static' . $request->getParameter('name') . '.php');
}

if (!$fileAsString) $this->forward404();

$this->fileAsString = $fileAsString;
}


So a cookie named haveYouSeenTheLandingPage should be set with a value of "About".

Any thoughts about why this is failing? Or is it working for some of you? If so, what browsers?

This question has been answered.

Lawrence Krubner | 06/05/11 at 5:29pm Edit


(2) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    06/05/11
    5:34pm
    Peter Michael says:

    Works on FF4/Windows Vista

    • 06/05/11 5:41pm

      Peter Michael says:

      Also works on
      - Safari 5.0.5
      - Chrome 11.0.696.71
      on Windows Vista

    • 06/05/11 5:54pm

      Lawrence Krubner says:

      Strange. I wonder why it doesn't work for me?

      Anyway, thanks all for the feedback. Very useful.

  • avatar
    Last edited:
    06/05/11
    5:35pm
    Utkarsh Kukreti says:

    Works on FF4 / Windows 7

This question has expired.



Lawrence Krubner voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.