ErrorException: Notice: Undefined index: domain #568

Closed
shekarsiri opened this Issue Mar 14, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@shekarsiri
Contributor

shekarsiri commented Mar 14, 2013

I am getting this error with recent update.

ErrorException: Notice: Undefined index: domain in C:\POWER\dev.assessment\vendor\laravel\framework\src\Illuminate\Session\SessionServiceProvider.php line 124

http://oi47.tinypic.com/316nscx.jpg

@jasonlewis

This comment has been minimized.

Show comment
Hide comment
@jasonlewis

jasonlewis Mar 14, 2013

Contributor

Sounds like you need to pull in the latest laravel/laravel develop branch. Taylor recently allowed some new configuration options for cookies.

Remember to git pull when you composer update.

Contributor

jasonlewis commented Mar 14, 2013

Sounds like you need to pull in the latest laravel/laravel develop branch. Taylor recently allowed some new configuration options for cookies.

Remember to git pull when you composer update.

@shekarsiri

This comment has been minimized.

Show comment
Hide comment
@shekarsiri

shekarsiri Mar 14, 2013

Contributor

Yep that works. thank you!

Contributor

shekarsiri commented Mar 14, 2013

Yep that works. thank you!

@Piusha

This comment has been minimized.

Show comment
Hide comment
@Piusha

Piusha Mar 5, 2017

in vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php expecting domain key. But in $app['config']['session']; array does not containing any domain attribute. therefor
setDefaultPathAndDomain() second parameter throws error.


public function register()
    {
        $this->app->singleton('cookie', function ($app) {
            $config = $app['config']['session'];
        
            return (new CookieJar)->setDefaultPathAndDomain($config['path'], $config['domain'], $config['secure']);
        });
    }

However $config['core'] will work instead $config['domain'].

For solution for this will be put code in app\config\session.php file that full fill both situation

'domain' => env('SESSION_DOMAIN', null),
'core' => env('SESSION_DOMAIN', null),

Piusha commented Mar 5, 2017

in vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php expecting domain key. But in $app['config']['session']; array does not containing any domain attribute. therefor
setDefaultPathAndDomain() second parameter throws error.


public function register()
    {
        $this->app->singleton('cookie', function ($app) {
            $config = $app['config']['session'];
        
            return (new CookieJar)->setDefaultPathAndDomain($config['path'], $config['domain'], $config['secure']);
        });
    }

However $config['core'] will work instead $config['domain'].

For solution for this will be put code in app\config\session.php file that full fill both situation

'domain' => env('SESSION_DOMAIN', null),
'core' => env('SESSION_DOMAIN', null),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment