2

I have placed in my env file:

 'session' => 
  array (
    'save' => 'files',
  ),

I have not mentioned the save path here. So where it will be saved as I could not find it in the var/session directory. I also want to know is it safe to use for a large scale website or I should use Redis instead.

PS: I have two questions for this-

Is it safe to use savepath as 'save_path' => 'var/session', because var folder has permission to read/write and common folder for saving. Also I want to know why people use redis instead of files. Is there any Cons for storing in var/session

Thanks

  • +1 for answer acceptance :) – Shoaib Munir Jul 8 at 11:46
1

If you mention session save path in env.php file then it will use that path.

Otherwise open your php.ini file and search for the value of session.save_path. This identifies where sessions are stored.

I am using redis for a Maento EE website, and it is working perfectly, I am getting no issue after applying redis.

Advantage of Redis: Sessions on redis will work more fast than file system. Other advantage is, you can save sessions globally and can use it on multiple servers, while file system has local storage and cannot be used in multiple servers.

  • is it safe to use savepath as 'save_path' => 'var/session', because var folder has permission to read/write and common folder for saving. – Stack user Jul 8 at 11:29
  • Also I want to know why people use redis instead of files. Is there any Cons for storing in var/session? – Stack user Jul 8 at 11:34
  • Yes, it is little bit risky to user var/session. But we had used this path for long time in magento 1.9. – Shoaib Munir Jul 8 at 11:34
  • Explanation for redis is added in answer. Please check – Shoaib Munir Jul 8 at 11:37
  • Ok thanks, So can I change the name of session folder name? like var/tempsession etc. will it effect anything? any idea? – Stack user Jul 8 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.