|
Posted by J.O. Aho on 09/29/62 11:32
Stefan Mueller wrote:
>> You could ID each page with an ID number and store the ID number in your
>> session, if the ID number from the session is the same as the pages, then
>> don't generate a new number.
>
> Yea, of course, I can store my random numbers within $_SESSION["..."]. I
> didn't realize that $_SESSION["..."] is a session variable. I was only
> focused on $_SESSION["count_session"].
>
> Many thanks
> Stefan
>
>>> PS: I don't like to use cookies
>> Session is a cookie.
>
> Does that mean that if a user disables cookies on this browser my page won't
> work?
> What will happen? Error message?
If cookies are disabled, it's will each time a page loaded result in that
isset($_SESSION["count_session"]) will be false, and your script will try to
set a new session but it will be ignored by the browser.
You should include a cookie check in your page (this could be done with
javascript and result in an alert if it notice that there hasn't been a cookie
set and tell the user that the site needs cookies to work properly, of course
the user could have disabled the javascript too and this case you can use a
reference check, if it notice that the reference is to your pages and it don't
find a cookie it could generate an error message to the page where telling
about cookies, but references can be turned off too).
//Aho
[Back to original message]
|