"Illuminate\Session\Store.php"의 두 판 사이의 차이

(새 문서: ==개요== ; <source lang='php'> namespace Illuminate\Session; use Closure; use Illuminate\Support\Arr; use Illuminate\Support\Str; use SessionHandlerInterface; use Illuminate\Contra...)
 
38번째 줄: 38번째 줄:
         $this->attributes = array_merge($this->attributes, $this->readFromHandler());
         $this->attributes = array_merge($this->attributes, $this->readFromHandler());
     }
     }
... (생략)
... (생략)
    /**
 
    * Regenerate the CSRF token value.
    *
    * @return void
    */
     public function regenerateToken()
     public function regenerateToken()
     {
     {

2017년 10월 7일 (토) 15:52 판

1 개요

namespace Illuminate\Session;

use Closure;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use SessionHandlerInterface;
use Illuminate\Contracts\Session\Session;

class Store implements Session
{
    protected $id;
    protected $name;
    protected $attributes = [];
    protected $handler;
    protected $started = false;

    public function __construct($name, SessionHandlerInterface $handler, $id = null)
    {
        $this->setId($id);
        $this->name = $name;
        $this->handler = $handler;
    }

    public function start()
    {
        $this->loadSession();
        if (! $this->has('_token')) {
            $this->regenerateToken();
        }
        return $this->started = true;
    }

    protected function loadSession()
    {
        $this->attributes = array_merge($this->attributes, $this->readFromHandler());
    }

... (생략)

    public function regenerateToken()
    {
        $this->put('_token', Str::random(40));
    }
... (생략)
}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}