SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: cookies

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Texas
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cookies

    I'm trying to set cookies accross my my site for users when they log in. Currently I've been trying using the setcookies() function. Well I try this and it doesn't seem to be working. I have the form to log in working perfect, then i have a test page where it shows if cookies are set or not, and it always shows them as not set. I have the setcookie() in the top of my head.php file so that all files would be affected by it. Anyone know what I could be doing wrong or something I might not have done. On the login form would I have to put something to say that the user is logged in and cookies should be set to keep the user logged in or what?
    Mark -
    www.magicscripts.net

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its been awhile since i touched any php, could u post the code so i could look at it?

    thanks

  3. #3
    SitePoint Member
    Join Date
    Jul 2001
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you considered using sessions instead of cookies? It is a much better and secure way of exchanging information across your website for each user. Eitherway, try posting the code here so we can check it for you.

  4. #4
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have define all the other options of setcookie. If the expire time is set to 0, the cookie will expire the moment another page is opened. You also need to specify which site address will be using the cookie and the cookie name.

    If you have already done all this and yet having problems, post your code here...
    i dunno...

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Texas
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol, I step away for 30 minutes and I get more replies then I did at any other forum over 3 weeks

    here what I have for the setcookie

    PHP Code:
    setcookie"portal""myportal"time()+3600"/""magicscripts.net"); 
    I've never used cookies nor sessions, so which would be better? And how do I use sessions?
    Mark -
    www.magicscripts.net

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Texas
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so can anyone help me out here?
    Mark -
    www.magicscripts.net

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Wolverhampton, UK
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://webmasterbase.com/article.php/319

    hope that helps
    beachball

  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Texas
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!
    Mark -
    www.magicscripts.net


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •