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:13] – [Cookie] tungntdevelopment:session-cookie [2024/08/21 08:29] (current) – [Cookie] tungnt
Line 4: Line 4:
  
 Cookie là một file chứa dữ liệu nhỏ có limit tầm 4k được lưu trên Client. Cookie là một file chứa dữ liệu nhỏ có limit tầm 4k được lưu trên Client.
- 
-**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ệ. 
  
 {{ :development:screenshot_2024-08-21_at_14.55.47.png |}} {{ :development:screenshot_2024-08-21_at_14.55.47.png |}}
 +
 +**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 ======
  
-{{ :development:screenshot_2024-08-21_at_14.57.52.png |}}+Một session bắt đầu 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ột file trên server. 
 + 
 +{{ :development:session-la-gi.jpg |}}
  
-https://www.youtube.com/watch?v=noxqc_CpVLQ+**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 ClientCá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.1724228005.txt.gz · Last modified: 2024/08/21 08:13 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki