Problem with slim 3(Update Middleware from v2 to v3)

Hi all ,
I have a problem when i upload my site with slim v2.5 and i get this error:
“Error A website error has occurred. The website administrator has been notified of the issue. Sorry for the temporary inconvenience.”.
After i use composer update to slim v3 and i get this error:
“Fatal error: Uncaught Error: Class 'Slim\Middleware\SessionCookie”

i use this function:
$builder = new CaptchaBuilder;
$app->add(new \Slim\Middleware\SessionCookie(array(‘secret’ => ‘myappsecret’, ‘expires’ => ‘30 minutes’)));
$app->add(new \Slim\Middleware\ContentTypes());

How i can update this function for Slim v3?

Thanks in advance

I don’t have any experience with Slim 2, but have you looked at the Middleware Signature section of the upgrade guide for Slim 3?

Thank you for your answer,I try it and i get more errors in the next lines of my index.php.
Also i try to use 3rd Middleware extension and i get always Class errors.

This is nice informative read, thanks for share.
Mothers Day Quotes With Images