#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    702
    Rep Power
    96

    Cookie creation fails?


    PHP Code:
    setcookie('allow_to_edit''PR'0'/'$_SERVER['SERVER_NAME']); 
    if (!isset(
    $_COOKIE['allow_to_edit']))
          print 
    "allow_to_edit NOT SET"
    Why can't I create this cookie? No errors are produced and I can create other cookies without a problem.
    Evan
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    what are the response headers from your server when you run this script? Check them with the developer tools of your browser. You should see a line line this:

    Code:
    Set-Cookie: allow_to_edit=PR; path=/; domain=...
    Is your error reporting on and up? Is there output before the function call? Also check its return value.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo