Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
921 views
in Technique[技术] by (71.8m points)

symfony - ErrorException: Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /../../

I am trying to create my own authentication provider like in http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html.

But, it keeps saying:

ErrorException: Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /../../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php line 56

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Symfony2 sessions will not work properly with "session auto start" enabled. So make sure that's disabled.

Make sure your php configuration php.ini has this configured: session.auto_start = 0.

Or you can add php_flag session.auto_start 0 to your .htaccess file if you can not edit the php.ini file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...