how can i make session not expire untill browser closed, and it shud resume after browser open.. likewise coding-talk remember me option.. should only expire on logout.. help me on this friends and also, will it open some security bug in lavalair?
please explain about sessions!!
Collapse
X
-
$_cookie
$coockiename = session;
$cookieexpire = time()+3600*24*30;
if(isset($_SESSION['session'])){
setcookie($cookiename, $session, $cookieexpire);
}
if(isset($_COOKIE[$cookiename])){
$session = $_COOKIE[$cookiename];
// or
echo $_COOKIE[$cookiename];/// debug
}
thats all...Last edited by timo; 19.08.12, 09:36.
-
Originally posted by chathumax View Posthow to prevent session hijacking?Code:ini_set ('session.cookie_lifetime', 0);
Code:$ip = 'Ip Addr Here'; $_SESSION['ip'] = $ip; if ( $_SESSION['ip'] === $ip){ //rest of code here }
Last edited by shushant; 30.12.12, 11:04.
Comment
-
Originally posted by chathumax View Posthow to prevent session hijacking?- by searching here, before posting
- by reading already posted solutions
- by using above mentioned solutions
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ â“â“¡â“” â“ⓑⓛⓔ ⓣⓞ â“—â“”â“â“¡ !
ιη тнєσÑу, тнє ÏÑα¢тι¢є ιѕ α Ñєѕυℓт σƒ тнє тнєσÑу, вυт ιη ÏÑα¢тι¢є ιѕ тнє σÏÏσѕιтє.
Comment
Comment