Laravel 5.4.36中session没有保存成功问题的解决 |
session使用注意点 laravel是一款php框架了,在使用laravel时会碰到session使用问题,工作中使用的是session默认的文件缓存,在使用过发现 源码:vendor/laravel/framework/src/Illuminate/Session/Store.php /** * Save the session data to storage. * * @return bool */ public function save() { $this->ageFlashData(); $this->handler->write($this->getId(), $this->prepareForStorage( serialize($this->attributes) )); $this->started = false; } 由于使用文件缓存 因此write方法调用的源码:vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php /** * {@inheritdoc} */ public function write($sessionId, $data) { $this->files->put($this->path.'/'.$sessionId, $data, true); return true; } 总结 以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对脚本之家的支持 。 您可能感兴趣的文章:
|