By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

Writing PHP with 'sessioned' and 'unsessioned' behaviour.

P: n/a
I'm writing a PHP program that produces two different kinds of output
depending on whether there is an active session.

I'm looking for a nice bit of code to do the initial checking.

This worked with register_globals=On :

if ($PHPSESSID) { session_start(); }

but I'd prefer to run with register_globals=Off . Also, doing
session_destroy() didn't seem to unset $PHPSESSID.

I'm currently using 4.2.2, but I'd like to write something that is
compatible with later releases (if at all possible).
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
.oO(Chris Guest)
I'm writing a PHP program that produces two different kinds of output
depending on whether there is an active session.

I'm looking for a nice bit of code to do the initial checking.

This worked with register_globals=On :

if ($PHPSESSID) { session_start(); }

but I'd prefer to run with register_globals=Off.


The session-ID can be found in the $_GET or $_COOKIE array.

Micha
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.