Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2007
    Location
    Latin America
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    setcookie not setting cookie...

    Hay, I tried using setcookie in my login form and it works perfectly in localhost, but not in any other webhost.

    PHP Code:
         setcookie('userid',$userid,(time()+214647);
         
    setcookie('userpassword',encrypt($password),(time()+214647)); 
    That problem is fixed now, but the cookies are set to expire at the end of the session! I want them to last a while. I even tried:

    PHP Code:
    setcookie('userid',$userid,8539214647);
    setcookie('userpassword',encrypt($password),8539214647); 
    And it still sets the cookie for the end of the session, help please!
    Last edited by Boshi; 08-25-2007 at 03:46 PM.

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,023
    Thanks
    2
    Thanked 314 Times in 306 Posts
    Check your web server log for errors and/or turn on full php error reporting in php.ini or a .htaccess file.

    I suspect that output buffering is turned on in php.ini in the case where it works, but it is not on in the cases where it does not work.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New Coder
    Join Date
    Jul 2007
    Location
    Latin America
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are no errors in the error log.

    Also I'm getting the errors in another webhost not in localhost.


  •  

    Posting Permissions

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