hi & thx for your replies....
@chris: thats exactly what I do right now, but I consider it a "workaround",
because I have to use session_register ("count"); first. the funny thing is,
that
when I call this page without an session id...
(just check.php instead of check.php?PHPSESSIONID=2178362178blah,
I disabled cookies for testing)
...PHP generates a session because of the session_register ("count");
command
even though I have "session.auto_start=0" in my php.ini...
If I press the refresh button of my browser I will have another session
generated
by PHP.......and another......and another.......and another....I think that
shouldn't
be. Anyway, its a very comfortable way to create loads of little (and
useless)
sessionfiles on my server ;)
@kaab & chadwick:
jepp, but session_register ("count"); also does the job. the problem is
that I don't want
PHP to generate a session if there is none on this page (check.php).....the
only way at the
moment seems to be that I:
1. session_register ("count"); (or sesstion_start();)
2. if (isset($count)) echo "everybody is happy";
else destroy_session(); // because there was an session generated
"accidentely")
humm. not very nice style. I expected the session_is_registered() function
to check for
the given vars in a session without the need of "session_start()" first. In
the end its not
too difficult to implement...
1. ist there a file called "sess_aSessionID" in session.save_path? [yes |
no]
2. [no] -> return false; (because there is no session)
3. [yes] -> open "sess_aSessionID" and check characters for aString [found |
notfound]
4. [notfound] -> return false;
5. [found] -> return true;
thats it (and what I expected).....and I wouldn't be forced to start a
session to find out.
I haven't been lazy and read some chapters about sessions.....but still the
"session_is_registered()"
function looks as useful to me as a "ceil(1);".
:(
greetz,
andi
"news.php.net" <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
9gss6k$kud$[EMAIL PROTECTED]
> hi everybody,
>
> maybe I get smth. wrong, but as far as I know the function
> "session_is_registered()"
> is used to find out if a var is registered in a session...
>
> ok, now here is my example:
>
> [ index.php ]
> <?php
> $count = "";
> session_start();
> session_register ("count");
> $count = "1";
> ?>
> .
> .
> .
> <a href="check.php">NEXT</a>
>
>
>
> [ check.php ]
> <?php
> if (session_is_registered("count")) {
> echo "yes, count is reg.<br>";
> }
> else {
> echo "no, count is not reg.<br>";
> }
> ?>
> .
> .
> .
>
>
> now, check.php always writes "no, count is not reg.", but I don't really
> understand, why!
> do I have to run a -> session_register ("count"); <- before using
> "session_is_registered"?
> But if I do this, there is no need to check for the var with
> "session_is_registered"....because
> I know the var is registered....
>
> maybe someone can help me out or point me to a good tutorial about
> sessions....
>
> thx in advance :)
> andi
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]