cookie for lava
Started on the old forum in August 2010 · view the original in the archive · old links redirect here
login.php
setcookie("sid", $value, time()+3600);//expires in 1 hour
collecting the cookie on other pages:
$sid = $_COOKIE["sid"];
logout page:
setcookie("sid", $value, time()-3600);//expired cookie 1 hour ago
yeah works ... you are better off using $_SESSION with mobiles though .... safety wise .... safer than using sessions in url`s however you would need to make the COOKIE more secure by protecting it against sql/html injection etc.
Is cookie supportable for every mobile ? 😛
/* I don't know everything hehe */
Using cookie is hardly secure too. Cross Site Requests is easier 🙂
WhyQ wrote: You mean using cookie is not secure for lavalair
COOKIES are as safe as you make them!
CreativityKills wrote: Using cookie is hardly secure too. Cross Site Requests is easier :)
can u give the example? how about if we sanity the cookie...
our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com
$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
To do a cross site forgery, i dnt nid to even know ur cookie. All i nid to knw is if u have a valid cookie set on ur system.
Can i use both $_session and $_cookie, how to using the both and also remember me
Added after 13 minutes:
Can i use both $_session and $_cookie, how to using the both and also remember me
have connected with http://adexchat.com ? Fun up with http://forum.adexchat.com
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
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"; echo "Please Bookmark this page to avoid repeating the login proccess in the future
"; $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"; echo "Please Bookmark this page to avoid repeating the login proccess in the future
";
}else{ echo "<img src=\"../images/point.gif\" alt=\"!\"/>Can't login at the time, pls try later"; //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.
setcookie("sid", $value, time()+3600);//expires in 1 hour
$value is for what??