|
 |
|
พี่ Num สุดยอดเทพ php จริง ๆค่ะ ถามอีกอย่างนะคะ ขอเป็นแนวทางหน่อยนะคะตอนนี้ทำเกี่ยวกับ session |
|
 |
|
|
 |
 |
|
มารับจุ๊บๆ ครับ 555+ (ตัดหน้าพี่หนุ่มซ่ะเลย อิอิ)
|
 |
 |
 |
 |
Date :
2009-08-02 13:41:02 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
การชมว่าพี่เป็นเทพ ไม่ได้ทำให้พี่เป็นเทพจริงๆ นา เอิกๆ 
1.
session_set_cookie_params(100);
session_start();
แบบนี้จะทำให้ข้อมูล $_SESSION ใช้งานไม่ได้หลังจากไม่ได้ติดต่อกับเว็บเป็นเวลา 100 วินาทีครับ
แต่ถ้าไม่ได้ตั้งไว้ session จะอยู่ได้นานไปเรื่อยๆ จนกว่าจะปิด browser
ถ้าตั้งเป็น 100 ถึงจะปิด browser เปิดขึ้นมาก็ยังไม่หายจนกว่าจะครบ 100 วินาทีครับ
2.
อันนี้ไม่เคยทำครับ แต่ดูท่าจะทำได้ยากครับ
3.
สร้าง field ใหม่ชื่อ click_logout ในตาราง user ครับ
ทุกครั้งที่ login สำเร็จให้ไป update field click_logout เป็น 0
และเวลากดปุ่ม loguot นอกจากจะเคลียร์ค่า session
ก็ไป update field click_logout ให้เป็น 1 ด้วยครับ
และก่อนจะให้ login ก็ตรวจค่าของ field click_logout ของ user คนที่ login ก่อนครับ
ว่ามีค่าเป็น 1 หรือเปล่า
|
 |
 |
 |
 |
Date :
2009-08-02 16:04:13 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปกติใส่ไว้ทุกที่ที่มี session_start(); นะครับ
|
 |
 |
 |
 |
Date :
2009-08-02 17:29:46 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขำ ดุนยา 
|
 |
 |
 |
 |
Date :
2009-08-02 19:22:34 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อยากแจมมมมด้วยคน (ไม่เก่งครับจึงนึงนำไม่ได้ อิอิ)
|
 |
 |
 |
 |
Date :
2009-08-02 22:49:26 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กำ พิมพ์ผิด "แนะนำ" >> นึงนำ
|
 |
 |
 |
 |
Date :
2009-08-02 22:50:08 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|