4

I get this error when enabling sessions, using the filesystem, in Laravel PHP.

Only variables should be passed by reference in SYS_PATH/session.php on line 230.

Stack Trace:
0 /Applications/XAMPP/xamppfiles/htdocs/laravel/system/session.php(230): System\{closure}(2048, 'Only variables ...', '/Applications/X...', 230, Array)

1 /Applications/XAMPP/xamppfiles/htdocs/laravel/system/session.php(190): System\Session::write_cookie()

2 /Applications/XAMPP/xamppfiles/htdocs/laravel/system/laravel.php(187): System\Session::close()

3 /Applications/XAMPP/xamppfiles/htdocs/laravel/public/index.php(44): require('/Applications/X...')

4 {main}

Snapshot:
225:     */
226:    private static function write_cookie()
227:    {
228:        if ( ! headers_sent())
229:        {
230:            extract(Config::get('session'));
231: 
232:            $minutes = ($expire_on_close) ? 0 : $lifetime;
233: 
234:            Cookie::put('laravel_session', static::$session['id'], $minutes, $path, $domain, $https, $http_only);
235:        }

Has anybody run into this issue? Even if you don't use Laravel, any insight?

1
  • Which version of the Laravel framework are you referring to? Commented Aug 24, 2011 at 8:37

2 Answers 2

8

That you're seeing the error message is a flaw in the Laravel PHP framework.

The session class makes use of the extract function that is expecting a variable, but it get's a function return.

I have reported this behavior to the project and you can discuss the options with them as well. You find a suggestion how to fix it attached, let me know if that works for you.

Sign up to request clarification or add additional context in comments.

Comments

0

What if instead of extracting the config to your local scope you just assign it to an array, and use those values? The error seems to be there, not with sessions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.