Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array" when Cookie Lifetime in Language Filter is set to Year #40421

Closed
ahotzler opened this issue Apr 19, 2023 · 6 comments

Comments

@ahotzler
Copy link
Contributor

Steps to reproduce the issue

Set up a Joomla with multilanguage.
In the plugin "Language Filter" set the "Cookie Lifetime" to "Year".
Update it to 4.3.0
Then the error appears "setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array": regardless of template or addons.

Expected result

No Error

Actual result

Error: "setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array"

System information (as much as possible)

Update Joomla (4.x to 4.3.0)
Tested on 2 installations

Setting Value
PHP Built On Linux xxx.andrehotzler.de 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64
Database Type mysql
Database Version 10.5.18-MariaDB-0+deb11u1
Database Collation utf8mb4_general_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 8.0.28
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 4.3.0 Stable [ Bora ] 18-April-2023 16:00 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Additional comments

Log from "everything.php":

2023-04-19T10:39:15+00:00 CRITICAL 91.35.2.88 error Uncaught Throwable of type ArgumentCountError thrown with message "setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array". Stack trace: #0 [ROOT]/libraries/src/Input/Cookie.php(102): setcookie('f9a9fa82b2a777f...', 'de-DE', Array, '', '', false, false)
#1 [ROOT]/plugins/system/languagefilter/languagefilter.php(807): Joomla\CMS\Input\Cookie->set('f9a9fa82b2a777f...', 'de-DE', Array)
#2 [ROOT]/plugins/system/languagefilter/languagefilter.php(481): PlgSystemLanguageFilter->setLanguageCookie('de-DE')
#3 [ROOT]/libraries/src/Router/Router.php(384): PlgSystemLanguageFilter->parseRule(Object(Joomla\CMS\Router\SiteRouter), Object(Joomla\CMS\Uri\Uri))
#4 [ROOT]/libraries/src/Router/Router.php(144): Joomla\CMS\Router\Router->processParseRules(Object(Joomla\CMS\Uri\Uri), 'preprocess')
#5 [ROOT]/libraries/src/Application/SiteApplication.php(746): Joomla\CMS\Router\Router->parse(Object(Joomla\CMS\Uri\Uri), true)
#6 [ROOT]/libraries/src/Application/SiteApplication.php(232): Joomla\CMS\Application\SiteApplication->route()
#7 [ROOT]/libraries/src/Application/CMSApplication.php(293): Joomla\CMS\Application\SiteApplication->doExecute()
#8 [ROOT]/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute()
#9 [ROOT]/index.php(32): require_once('/var/www/k24950...')
#10 {main}

@brianteeman
Copy link
Contributor

@ahotzler
Copy link
Contributor Author

Ah, i didnt find this using google

@Fedik
Copy link
Member

Fedik commented Apr 19, 2023

Please test #40414

@Fedik Fedik closed this as completed Apr 19, 2023
@ahotzler
Copy link
Contributor Author

will test tomorrow, thank you

@richard67 richard67 added the bug label Apr 19, 2023
@sentixGmbH
Copy link

#40414 will not bring a solution. Problem still exists with Google Chrome (not with Firefox). But error message changes from setcookie-Error to a 503 error code (service unavailable)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40421.

@sentixGmbH
Copy link

Error does not happen if language filter plugin is disabled. If enabled, cookie lifetime changed to "session" doesn't help


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40421.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants