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

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    14
    Here are my snippet?

    # set cookie for login INP
    function set_inp_cookie($email,$md5password) {
    setcookie("cookie_email",$email,time()+1000);
    setcookie("cookie_md5password",$md5password,time()+1000);
    }

    I use this function to set cookie. I set it yesterday, I was surprised to view it in my IE today.
    here is my view function:
    # get email form cookie
    function get_email_from_cookie() {
    global $HTTP_COOKIE_VARS;
    $email = $HTTP_COOKIE_VARS["cookie_email"];
    return $email;
    }

    Anyone some idea?


    ------------------
    Good Good Study
    Day Day Up
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    Are you sure you want your cookies to expire approx. 17 minutes after they're set? :P the timeout for cookies is called by seconds, so you're better off using a higher value, such as

    60(60) = 3600 = 1 hour,
    3600(24) = 86400 = 1 day,
    86400(365) = 1 year
    and so on.

    ------------------
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    16
    Rep Power
    0


    well, looking at your code, i think you have an error in there. i could be wrong, but just look.

    i think this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>setcookie("cookie_email",$email,time()+1000);[/code]
    should be this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>setcookie("cookie_email",$email,((time())+1000));[/code]
    i know this doesn't look right, but i think that's how it's supposed to be.

    also, then, you might want to change this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>setcookie("cookie_md5password",$md5password,time()+1000);[/code]
    to this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>setcookie("cookie_md5password",$md5password,((time())+1000));[/code]


    and note that cka is right about it expiring merely 16.67 minutes later. perhaps you are using this so that users can only get into a page for a short amount of time? or something like that? if not, you might want to change it, per cka's recommendation and instructions.


    later.


    Cujo


Similar Threads

  1. using session timeout without cookies
    By me_helper in forum PHP Development
    Replies: 6
    Last Post: July 27th, 2006, 02:45 AM
  2. Replies: 1
    Last Post: August 22nd, 2003, 03:32 PM
  3. fsockopen timeout problem
    By Jason Keeler in forum PHP Development
    Replies: 1
    Last Post: June 22nd, 2003, 11:25 AM
  4. error log - what mistakes should I look for?
    By mano1 in forum MySQL Help
    Replies: 0
    Last Post: January 8th, 2002, 01:14 PM
  5. fsockopen timeout php4.0.6
    By jamesbond2002 in forum PHP Development
    Replies: 1
    Last Post: November 27th, 2001, 05:57 AM

IMN logo majestic logo threadwatch logo seochat tools logo