How to Change PHP session.save_path in Plesk

PHP session storage

Change session.save_path only when the application requires a writable, private session directory

Most hosted applications should use the working Plesk default. A custom path can solve a documented application or isolation requirement, but it must exist, belong to the correct subscription and stay outside publicly downloadable web content.

DEFAULTLeave it when workingAvoid needless change
PATHPrivate and writableCorrect ownership
TESTOne domain firstVerify login flows

When is a custom session path appropriate?

Documented application need

The software vendor explicitly requires file-based sessions in a particular writable location.

Broken default path

Logs show that PHP cannot create session files and the current path or ownership is genuinely invalid.

Deliberate isolation

A developer needs a private per-subscription location and understands cleanup and permissions.

Not a general speed tweak

Changing the path does not automatically improve performance and can break authentication if configured incorrectly.

Set session.save_path for one domain in Plesk

  1. 1
    Record the current value

    Check PHP Settings or a temporary diagnostic page, then remove that diagnostic page after use.

  2. 2
    Create a private directory

    Place it within the subscription’s private area, not in a public web directory, and apply restrictive ownership.

  3. 3
    Open PHP Settings

    Select the domain in Plesk and add the required session.save_path value at domain scope.

  4. 4
    Apply and test

    Confirm the effective value, then test login, baskets, forms and any other session-dependent workflow.

What to check if sessions still fail

CheckWhy
Directory existsPHP cannot write into a missing path
Ownership and permissionsThe domain’s PHP handler needs controlled write access
Disk space and inode useA full filesystem can prevent session creation
Effective PHP handlerCLI and website PHP can load different configuration
Session cleanupOld files should expire without deleting active sessions too aggressively

PHP session questions

Can I change session.save_path in .htaccess?

That depends on the PHP handler and may be ignored or cause an error. Use the domain’s Plesk PHP Settings for a predictable scoped change.

Should the directory be inside httpdocs?

No. Session files can contain sensitive state and should be kept outside publicly served content.

Why does php -i show a different value?

Command-line PHP can use a different configuration from the website handler. Verify through the domain’s effective PHP configuration.

Change only with a reason

Keep session storage private, scoped and testable

Record the old value so you can reverse the change if the application behaves differently.

Was this helpful?
How to Change PHP session.save_path in Plesk written by UKC average rating 4.5/5 - 2 user ratings