Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session read should lock data #2

Open
rjha opened this issue Aug 13, 2012 · 0 comments
Open

session read should lock data #2

rjha opened this issue Aug 13, 2012 · 0 comments

Comments

@rjha
Copy link

rjha commented Aug 13, 2012

The way PHP reads session data is : -
start page execution
read session data
work with session data
page execution over
write session data

That means session data is loaded only once. So access to session data should be locked. The sequence should be

  • get lock
    • read data
    • write data
    • release lock

Without a lock in place - we may have corrupt session data. We have to "emulate" the locking behavior of default PHP sessions.

@see http://www.mysqlperformanceblog.com/2007/03/27/php-sessions-files-vs-database-based/
@see http://stackoverflow.com/questions/1022416/how-to-properly-implement-a-custom-session-persister-in-php-mysql/10422239#10422239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant