cookie for lava

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    $value

    what should be i equal to
    $value = " ";
    Last edited by hunter-x-hunter; 17.03.11, 14:35.

    Comment


      #17
      ok, something like this in your core:

      $sid = $_COOKIE["SESSIONID"];
      $inTwoMonths = 60 * 60 * 24 * 60 + time();
      $res = setcookie("SESSIONID", $sid, $inTwoMonths);

      then

      setcookie("SESSIONID", $sid, $inTwoMonths); at login

      and

      $backTwoMonths = time() - (60 * 60 * 24 * 60);
      $res = setcookie("SESSIONID", $sid, $backTwoMonths);

      in logout

      oh and remove $sid= $_GET['sid'] in all pages
      C3 Themes: http://c3themes.wen.ru/index.html
      Find Files: http://mystarter.tk/?goto=X-search

      Comment


        #18
        Where in login.php do i put

        setcookie("sid", $value, time()+3600);//expires in 1 hour

        ?

        Cos in my login.php, i have this

        $tm = time();
        $xtm = $tm + (getsxtm()*60);
        $did = $uid.$tm;
        $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");

        if($res)
        {
        $tolog=true;
        echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You have logged in successfully as $uid<br/>";
        echo "Please Bookmark this page to avoid repeating the login proccess in the future<br/><br/>";
        $idn = getuid_nick($uid);

        $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));
        mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."' WHERE id='".$idn."'");
        }else{
        //is user already logged in?
        $logedin = mysql_fetch_array(mysql_query("SELECT (*) FROM ibwf_ses WHERE uid='".$getuid_nick($uid)."'"));
        if($logedin[0]>0)
        {
        //yip, so let's just update the expiration time
        $xtm = time() + (getsxtm()*60);
        $res = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE uid='".getuid_nick($uid)."'");

        if($res)
        {
        $tolog=true;
        echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You have logged in successfully as $uid<br/>";
        echo "Please Bookmark this page to avoid repeating the login proccess in the future<br/><br/>";


        }else{
        echo "<img src=\"../images/point.gif\" alt=\"!\"/>Can't login at the time, pls try later<br/>"; //no chance this could happen unless there's error in mysql connection

        }

        }

        }

        }
        }
        Please help. And please don't flame me, i know am a noob.

        Comment


          #19
          line 5 of above code should do it.

          Comment


            #20
            setcookie("sid", $value, time()+3600);//expires in 1 hour

            $value is for what??

            Comment


              #21
              $value is $sid

              Comment


                #22
                lava is not secured for cookies, dnt be mistaken :P

                Comment

                Working...
                X