PHP Sessions - Locking and Sharing questions

Posted by Nuno Peralta on Stack Overflow See other posts from Stack Overflow or by Nuno Peralta
Published on 2010-05-29T20:39:32Z Indexed on 2010/05/29 20:42 UTC
Read the original article Hit count: 278

Filed under:
|

Hi,

I would like to know if it is possible to read $_SESSION attributes without locking it.
Currently, session_start() locks SESSION, that means other PHP processes will wait until it is unlocked.
But, some processes just want to get some $_SESSION variables, not to write on them.
Is that possible to implement some function like session_get(string $id) which doesn't lock SESSION?

Also, it is possible to share SESSIONs between browsers, once the user is logged in the same account, for example, using session_id('shared_vars_of_'.$userid). But, is that secure? Is this discouraged?

Thanks,
Nuno

© Stack Overflow or respective owner

Related posts about php

Related posts about sessions