Super Globals
IT Notes → PHP @ December 22, 2020
- If register_globals turned ON the super globals will be stored in its corresponding local variables creating security issues. So, we need to initialize local variables before use.
- session_start( ) => PHP will check to see whether the visitor sent a session cookie. If it did, PHP will load the session data. Otherwise, PHP will create a new session file on the server, and send an ID back — SESSID or whatever name in config file.
- Clear session data for a user => $_SESSION = array(); session_destroy( ); For a particular session variable use unset.
- Sessions store only Id in a cookie and it expires when browser closes. It cannot be used outside a specific web browser. The corresponding datafile is stored on the server.
- Setcookie(name, value, expiry, path, domain, secure) //Before any html output.
- Cookies are hackable and permanent, can work with cluster of web servers, set with first page and resent back with every page.
Subscribe
Login
0 Comments