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!!
Started on the old forum in August 2012 · view the original in the archive · old links redirect here
$_cookie
$coockiename = session; $cookieexpire = time()+36002430;
if(isset($_SESSION['session'])){ setcookie($cookiename, $session, $cookieexpire); }
if(isset($_COOKIE[$cookiename])){ $session = $_COOKIE[$cookiename]; // or echo $_COOKIE[$cookiename];/// debug }
thats all...
chathumax wrote: how to prevent session hijacking?
ini_set ('session.cookie_lifetime', 0);
small trick to avoid session hijacking
$ip = 'Ip Addr Here';
$_SESSION['ip'] = $ip;
if ( $_SESSION['ip'] === $ip){
//rest of code here
}
chathumax wrote: how 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. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!