Git Product home page Git Product logo

Comments (7)

overtrue avatar overtrue commented on May 29, 2024

因为此购物车是基于 session 的,所以在存储完成后你不能在后面中断进程,比如 dd() 这样,这样 session 不会正确写入,所以你到其它 controller 中就拿不到了。因为 laravel 的 session 是后续写入的。

from laravel-shopping-cart.

billyluu avatar billyluu commented on May 29, 2024

我原本在商品頁裡加入購物車 然後到購物車頁卻沒有看到商品
所以才用dd() 去看session裡有沒有東西

from laravel-shopping-cart.

overtrue avatar overtrue commented on May 29, 2024

@sheng0208 嗯,laravel 的 session 是在 response 发送后才写入真正的 session 中,所以你在 dd 的时候看到的只是 class instance 中 property 存储的内容,并不是真正写到 session 后的内容。

from laravel-shopping-cart.

billyluu avatar billyluu commented on May 29, 2024

但我剛剛dd註解後 在商品頁面加入購物車後
到購物車畫面 依然沒有看到加入的商品

from laravel-shopping-cart.

overtrue avatar overtrue commented on May 29, 2024

@sheng0208 这可能是其它原因,你可以跟一下代码具体在哪一步丢失了,你使用什么来存储 session?

from laravel-shopping-cart.

billyluu avatar billyluu commented on May 29, 2024

我大概知道問題了 謝謝你

from laravel-shopping-cart.

overtrue avatar overtrue commented on May 29, 2024

@sheng0208 不客气。

from laravel-shopping-cart.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.