#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    14
    Rep Power
    0
    I use cookies to track movements around my site. I assign every user/browser an id and use this when I log page impressions.

    The problem I have is when the visitor needs to use the secure parts of my site. The secure url is different from the non-secure one (e.g. https://secure.site.com and http://www.site.com).

    I'm setting the id as follows:
    setcookie("id", $uniqueid, $longlifetime);

    How can I make this cookie accessible/viewable from within https://secure.site.com?

    Thanks
    Mark
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    45
    Rep Power
    15
    Use two additional fields when you set your cookie (you will have to set it 2 times). Do

    setcookie("id",$uniqueid,$longtime,"/","http://www.site.com");
    AND

    setcookie("id",$uniqueid,$longtime,"/","https://secure.site.com");

    that should do it...
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    43
    Rep Power
    15

    The last argument in setcookie indicates whether or not the cookie is secure or not.
    0 = not secure
    1 = secure
    So you can add the argument as below:

    setcookie("id",$uniqueid,$longtime,"/","http://www.site.com,0");
    AND

    setcookie("id",$uniqueid,$longtime,"/","https://secure.site.com,1");



    ------------------
    webpatron.com

Similar Threads

  1. please help: https -> http
    By vhermawa in forum Apache Development
    Replies: 2
    Last Post: September 27th, 2003, 10:21 PM
  2. HTTP versus HTTPS
    By linh in forum Apache Development
    Replies: 2
    Last Post: September 19th, 2003, 11:02 AM
  3. http > https and vice versa rewrite rule
    By freemanvt in forum Apache Development
    Replies: 0
    Last Post: September 15th, 2003, 12:48 PM
  4. https to http question
    By kss29819 in forum HTML Programming
    Replies: 0
    Last Post: September 8th, 2003, 12:28 PM
  5. https, http configuration
    By violaplayer in forum Security and Cryptography
    Replies: 0
    Last Post: September 7th, 2003, 02:45 AM

IMN logo majestic logo threadwatch logo seochat tools logo