please explain about sessions!!

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

    please explain about sessions!!

    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?

    #2
    $_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.

    Comment


      #3
      session hijack

      how to prevent session hijacking?

      Comment


        #4
        Originally posted by chathumax View Post
        how to prevent session hijacking?
        Code:
        ini_set ('session.cookie_lifetime', 0);
        small trick to avoid session hijacking
        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


          #5
          Originally posted by chathumax View Post
          how to prevent session hijacking?
          1. by searching here, before posting
          2. by reading already posted solutions
          3. 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ノ刀ノイリ!

          Comment

          Working...
          X