#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Hi,

    I am trying to use SetCookie to post information between two domains unfortunetly I can not get it to work on the one yet. I can not get it to work with any other parameters other than the name and value.

    Although I am not sure if this workinf correctly. I have spent some time working out whether it works properly or not but only managing to achieve a large pulsating headache.

    Nutscape seems to work and IE doesn't. Any ideas would be hugely appreciated.

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

    Join Date
    Apr 1999
    Location
    London
    Posts
    110
    Rep Power
    0
    try this

    SetCookie("SessionId",$cartID,time()+2592000);

    the only bit after that is the path and domain and some secure thing (which I'm not sure about), if you want to include more info like the time or whatever if you repeat the SetCookie with different variables in it and sit will make one big cookie for you

    eg

    $cartID = md5(uniqid(rand()));
    $time = mktime();
    SetCookie("SessionId",$cartID,time()+2592000);
    SetCookie("SessionIdTime",$time,time()+2592000);

    will generate this as a cookie...

    SessionIdTime
    948815550
    whatever URL and path/
    0
    667529984
    29327071
    381841344
    29321036
    *
    SessionId
    735f83820533a26431f2817140b878d0
    whatever URL and path/
    0
    667529984
    29327071
    382041344
    29321036
    *

    you cvan then call either SessionId or SessionIdTime in your next page

    hope it helps


    ------------------
    cheers

Similar Threads

  1. Placing user-entered data into cookie
    By Tyrone in forum Perl Programming
    Replies: 2
    Last Post: February 17th, 2004, 04:31 PM
  2. ASPSESSIONID cookie seems to kill JavaScript cookie
    By cdarling in forum JavaScript Development
    Replies: 1
    Last Post: July 25th, 2003, 12:25 PM
  3. javascript - cookie based redirect... not working?
    By drgroove in forum JavaScript Development
    Replies: 4
    Last Post: July 4th, 2003, 01:55 AM
  4. Per session cookie expiration
    By csaba in forum PHP Development
    Replies: 4
    Last Post: June 21st, 2002, 09:54 PM
  5. cookie and security
    By itsource in forum HTML Programming
    Replies: 1
    Last Post: March 20th, 2002, 05:52 PM

IMN logo majestic logo threadwatch logo seochat tools logo