Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tutorial - https://youtu.be/TrWda1AwyAA
- //Secure sessions - http only - will only work on https connection
- function sessionStart($lifetime, $path, $domain, $secure, $httpOnly){
- session_set_cookie_params($lifetime, $path, $domain, $secure, $httpOnly);
- session_start();
- }
- //Cookies
- $domain = 'localhost';
- $myTime = time()+(10 * 365 * 24 * 60 *60);
- setcookie ("member_login", $email,$myTime, '/', $domain, true, true);
- //To double check these are HttpOnly and Secure, when in your browser, press f12, goto the application tab, look under cookies and sessions. You should see a tick in both HttpOnly and Secure column
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement