Hey everyone, I’m new to Laravel 11 and I’m trying to create an Atlassian Jira Cloud Connect App. I’m running into a problem during installation. The error message says ‘local.ERROR: Session store not set on request on installation.’
I’ve set up an InstallationController to handle the store function, created routes in web.php, and added a VerifyCsrfToken middleware. But something’s not clicking.
Here’s a simplified version of what I’ve got:
// InstallationController.php
public function setup(Request $req)
{
$appKey = $req->input('appKey');
$appUrl = $req->input('appUrl');
$app = new JiraApp();
$app->app_key = $appKey;
$app->app_url = $appUrl;
try {
$app->save();
return response()->json(['status' => 'success']);
} catch (Exception $e) {
return response()->json(['status' => 'error'], 500);
}
}
I’m using XAMPP with ngrok, and the logs show a 419 unknown status error.
Any ideas on what I’m missing or doing wrong? I’d really appreciate some guidance on getting this to work properly. Thanks!
I’ve been through a similar situation with Laravel and Atlassian Connect, and it can be tricky. The ‘Session store not set’ error often occurs when Laravel can’t establish a session, which is crucial for CSRF protection.
First, ensure your app is using the web middleware group, which includes session handling. In your routes file:
Route::middleware('web')->group(function () {
// Your routes here
});
Also, check if your app is configured to use the correct session driver. In your .env file, make sure you have:
SESSION_DRIVER=file
If you’re still facing issues, you might need to disable CSRF protection for your Atlassian routes temporarily. Add the route to the $except array in app/Http/Middleware/VerifyCsrfToken.php:
protected $except = [
'atlassian/*',
];
Remember, disabling CSRF should be a last resort. It’s better to figure out why the session isn’t being set properly. Have you tried clearing your config cache? Sometimes that helps:
php artisan config:clear
Hope this helps you get unstuck!
I encountered a similar issue when setting up a Jira Connect app with Laravel 11. One crucial step that’s often overlooked is configuring the session lifetime. In your .env file, ensure you have:
SESSION_LIFETIME=120
This sets the session to expire after 120 minutes. Adjust as needed.
Additionally, check your config/session.php file. Make sure ‘same_site’ is set to ‘none’ and ‘secure’ is true:
‘same_site’ => ‘none’,
‘secure’ => true,
These settings are essential for cross-domain cookies, which Jira Connect apps often require.
Lastly, verify your app’s manifest file (atlassian-connect.json). Ensure the baseUrl matches your ngrok URL exactly. A mismatch here can cause unexpected behavior during installation.
If you’re still stuck, enable debug mode in your .env file and check the Laravel logs for more detailed error messages. They often provide crucial clues for resolving these types of issues.
hey mate, i had similar headaches with laravel 11 and jira connect. have u checked ur session config? sometimes it’s not set right for these apps. also, try clearing ur route cache with ‘php artisan route:clear’. that fixed it for me. good luck!