I want to learn how to create php session ? Please teach me step by step easyly. Suppose, Create mysql table with 2 or more fields (your wish) Create a login php including session Create atleast 2 php for member/logged-in area Create logout php that will destroy session I want that, if a member close page without login, It will automaticall destry session and make logged out. I also need that if a user inactive for 20 minutes after login then it will destry session and ask for login again. No need more hatme code but just 1/2 line(s) Please teach me as short as you can. Thanks in advance
<?php session_start(); // Start a new session $_SESSION['ok'] = "Something here"; // assign value echo $_SESSION['ok']; // use our session variable ?> PHP:
grab yourself a book or download some sample code and learn what it does. That's the best way. I believe no one here has the time to spoon feed you
session destroy function can be used for user to logout without closing the browser. if user close browser without log out, session will automatically destroy. for timing seesion you must use cookie.