Posted By

kameshsoft on 01/15/13


Tagged

php cookie function KAMESHsoft


Versions (?)

Advanced cookie function with php


 / Published in: PHP
 

URL: http://ksoft.is-great.org

To set cookie use "cookie('name of your cookie','cookie data','expire date ')" it will set your cookie in the user browser . To get the saved cookie use "cookie('name of your cookie')" it will give you the value of the cookie which you saved in the user's browser .

  1. <?php
  2. /*
  3. If you have doubt please ontact me : [email protected]
  4. */
  5. function cookie($name , $val = null , $exp = 0){
  6. if($val == null) return $_COOKIE[$name];
  7. else{
  8. return setcookie($name, $val , $exp);
  9. }
  10. }
  11. ?>

Report this snippet  

You need to login to post a comment.