First, this list is for the development _of_ PHP, not development _with_ PHP, so further discussion of this and similar subjects should appear on the php-general list.
Try something like:I have a site in wich user can register, but everyone can navigate as Guest, even if he/she is nt registered. The problem is that I need session for registered user, but I don't need them for unregistered ones! So I tried to check if they already have an opened session (they are registered), but to check it I have to do a session_start(), and this will OPEN a session if it's not opened! So I'll have an opened session for every guest I have in the site. This is difficult for me because I would like session to last very long, and many empty session waste a lot of space!
if( isset( $REQUEST[ 'PHPSESSID' ] )) { # User is registered/logged in
session_start();
}
This is based on looking for the cookie or get value for PHPSESSID, the default session name. If it is set, then either a cookie with the session ID is set, or the session is being passed in the URL.
Rick
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php