TungNT (Blue)

tungnt.blue@gmail.com

User Tools

Site Tools


development:session-cookie

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:session-cookie [2024/08/21 08:21] – [Session] tungntdevelopment:session-cookie [2024/08/21 08:29] (current) – [Cookie] tungnt
Line 8: Line 8:
  
 **Cơ chế hoạt động của Cookie:** Request đầu tiên từ Client lên Server, Server sẽ tạo 1 cookie và lưu lại sau đó response lại cho Client thông tin cookie đã được lưu. Từ những lần request sau, cookie sẽ được gửi kèm lên Server & sẽ được xác minh tính hợp lệ của request xem có đúng từ Client gửi lên không. **Cơ chế hoạt động của Cookie:** Request đầu tiên từ Client lên Server, Server sẽ tạo 1 cookie và lưu lại sau đó response lại cho Client thông tin cookie đã được lưu. Từ những lần request sau, cookie sẽ được gửi kèm lên Server & sẽ được xác minh tính hợp lệ của request xem có đúng từ Client gửi lên không.
 +
 +{{ :development:session-la-gi-cookie-la-gi.png |}}
  
 ====== Session ====== ====== Session ======
  
-Cookie lưtrữ tại Client, còn Session là thông tin lưu trữ tại Server.+Một session bắt đầkhi client gửi request đến server, nó tồn tại xuyên suốt từ trang này đến trang khác trong ứng dụng web và chỉ kết thúc khi hết thời gian timeout hoặc khi bạn đóng ứng dụng. Giá trị của session sẽ được lưu trong mộfile trên server.
  
-{{ :development:screenshot_2024-08-21_at_14.57.52.png |}}+{{ :development:session-la-gi.jpg |}}
  
 **Cơ chế hoạt động của Session:** Khi Client request lên server lần đầu, Server sẽ tạo một session_id (được lưu trữ ở bất kỳ đâu: memory, database, file, redis,...) và gửi lại session_id cho Client. Các lần sau, Client sẽ gửi kèm session_id lên và Server sẽ xác minh tính hợp lệ của request. **Cơ chế hoạt động của Session:** Khi Client request lên server lần đầu, Server sẽ tạo một session_id (được lưu trữ ở bất kỳ đâu: memory, database, file, redis,...) và gửi lại session_id cho Client. Các lần sau, Client sẽ gửi kèm session_id lên và Server sẽ xác minh tính hợp lệ của request.
development/session-cookie.1724228516.txt.gz · Last modified: 2024/08/21 08:21 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki