Manish Jesani Manish Jesani - 1 month ago 23
PHP Question

session_set_cookie_params(0) not working in Google Chrome

I add this code for close browser destroy session.

This code works fine Mozilla, Opera but doesn't work in Chrome.

I also set

session.cookie_lifetime = 0
in php.ini file.

ini_set('session.cookie_lifetime', 0);
session_set_cookie_params(0);

session_start();

Answer

Change sequence of session

session_start(); 
session_set_cookie_params(0);
Comments