Search code examples
zend-framework

How to rename the cookie name from PHPSESSID to SOMEOTHER in Zend Framework 1


I did already tried approach of zend framework 1. I did place this code of line in my application.ini file which is this

resources.session.use_only_cookies = true
resources.session.save_path = "/tmp"
resources.session.remember_me_seconds = 864000
resources.session.cookie_httponly = true
resources.session.cookie_secure = On
resources.session.name = "SOMEOTHER"

But it does not working still name is showing "PHPSESSID". I am attaching a screen shot for your reference.

screenshot which is showing cookie name Thanks is advance.


Solution

  • I did resolve this issue

    We don't need to do major thing. 1. Just Install Zend Session Library in project folder. 2. Include/Use Installed library (use Zend\Session\Config\SessionConfig), Create a function "_initSession" in Zend Bootstrap.php file 3. And write this line of code

    $sessionConfig = new SessionConfig();
    $sessionConfig->setOptions(array('name' => 'SOMEOTHER'));