Is this the right way to set a cookie?

Posted by AAA on Stack Overflow See other posts from Stack Overflow or by AAA
Published on 2011-03-20T16:09:06Z Indexed on 2011/03/20 16:09 UTC
Read the original article Hit count: 154

Filed under:
|
|
|

// if login is ok then we add a cookie

         $_POST['user_name'] = stripslashes($_POST['user_name']); 

          $hour = time() + 3600; 

             setcookie(ID_my_site, $_POST['user_name'], $hour); 

            setcookie(Key_my_site, $_POST['password'], $hour);   

Is this a right way to set cookies? Its been causing me serious redirect errors. See here: PHP Redirect problem with subdomain

© Stack Overflow or respective owner

Related posts about php

Related posts about session