6
57
Fork
You've already forked smolfedi
5

Fix for authorization issues on shared hosting (custom session path) #3

Closed
opened 2026年04月11日 20:06:21 +02:00 by roblen · 1 comment

I encountered an issue where authorization would fail on certain shared hosting environments. After redirecting back from the provider, the application would "lose" the session state, making it impossible to complete the login.

Cause:
This is often caused by restrictive permissions or aggressive garbage collection in the server's default PHP session directory (e.g., /var/lib/php/sessions).

Solution:
Defining a custom, local session path within the webspace resolves this. I added the following line to the bootstrap.php to ensure the application uses its own protected directory for session data:

ini_set('session.save_handler', 'files');
ini_set('session.save_path', SESSIONS_PATH);
I encountered an issue where authorization would fail on certain shared hosting environments. After redirecting back from the provider, the application would "lose" the session state, making it impossible to complete the login. Cause: This is often caused by restrictive permissions or aggressive garbage collection in the server's default PHP session directory (e.g., /var/lib/php/sessions). Solution: Defining a custom, local session path within the webspace resolves this. I added the following line to the bootstrap.php to ensure the application uses its own protected directory for session data: ``` ini_set('session.save_handler', 'files'); ini_set('session.save_path', SESSIONS_PATH); ```
Owner
Copy link

Thanks

ea1cd7deac

Thanks https://codeberg.org/adele/smolfedi/commit/ea1cd7deacd5232427798d9c26397c4f8ee92a45
Sign in to join this conversation.
No Branch/Tag specified
main
v1.2.8
v1.2.7
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.0
v1.0.11
v1.0.10
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
adele/smolfedi#3
Reference in a new issue
adele/smolfedi
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?