php session

Discussion in 'PHP' started by bharath120, Feb 5, 2007.

  1. #1
    hi,i am new to php ,

    i hv created login page,registere..........

    nw i want to give session timeout for login user........and please send me one example.

    plzz help....
     
    bharath120, Feb 5, 2007 IP
  2. technoguy

    technoguy Notable Member

    Messages:
    4,369
    Likes Received:
    306
    Best Answers:
    0
    Trophy Points:
    205
    #2
    I use iframe pages, so I made the following In main pages I make the following check

       if (!isset($_GET["sessionName"])) Header("Location: index.php");
         session_name($_GET["sessionName"]);
         session_start();
         if (!isset($_SESSION["user_id"])) Header("Location: index.php");
    
    In iframe pages:
    
         if (!isset($_SESSION[$_SESSION["user"]."_id"])) {
    ?>
         <script>
         window.parent.location.href = '<?php echo ($_SESSION["user"] == "user" ? "index.php" : "indexa.php") ?>';
         </script>
    <?php 
         }
    PHP:
     
    technoguy, Feb 5, 2007 IP
  3. bharath120

    bharath120 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3


    hi,i am sending my code in below attachments,u please go through the code and send me hw to write session timeout for the login page.
     

    Attached Files:

    bharath120, Feb 5, 2007 IP