SessionHandlerInterface::close

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

SessionHandlerInterface::close โ€” ใ‚ปใƒƒใ‚ทใƒงใƒณใ‚’้–‰ใ˜ใ‚‹

่ชฌๆ˜Ž

public function SessionHandlerInterface::close(): bool

็พๅœจใฎใ‚ปใƒƒใ‚ทใƒงใƒณใ‚’้–‰ใ˜ใพใ™ใ€‚ใ“ใฎ้–ขๆ•ฐใฏใ‚ปใƒƒใ‚ทใƒงใƒณใ‚’้–‰ใ˜ใ‚‹ใจใใซ่‡ชๅ‹•็š„ใซๅฎŸ่กŒใ•ใ‚Œใพใ™ใ€‚ ใ‚ใ‚‹ใ„ใฏใ€ๆ˜Ž็คบ็š„ใซ session_write_close() ็ตŒ็”ฑใงๅฎŸ่กŒใ™ใ‚‹ใ“ใจใ‚‚ใงใใพใ™ใ€‚

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

ใ“ใฎ้–ขๆ•ฐใซใฏใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ๆˆปใ‚Šๅ€ค

่ฟ”ใ‚Šๅ€ค (้€šๅธธใฏใ€true ใŒๆˆๅŠŸใใ—ใฆ false ใŒๅคฑๆ•—ใ‚’่กจใ—ใพใ™)ใ€‚ใ“ใฎๅ€คใฏ PHP ใงๅ†…้ƒจ็š„ใซๅ‡ฆ็†ใ•ใ‚Œใ‚‹ใ‚‚ใฎใงใ‚ใ‚‹ใ“ใจใซๆณจๆ„ใ—ใพใ—ใ‚‡ใ†ใ€‚

๏ผ‹add a note

User Contributed Notes 1 note

up
5
svenr at selfhtml dot org ยถ
13 years ago
This method should release the exclusive lock that was acquired by the open() method.

Note that this will effectively serialize parallel requests, which affects performance for a single user session.

Not locking the resource would on the other hand allow for race conditions if two or more parallel requests change the session data.