13. When you write a cookie with an expiration date in
the future to a particular machine, the cookie never seem to be set. The
technique usually works with other computers, and you have checked that the
time on the machine corresponds to the time on the server within a reasonable
margin by verifying the date reported by the operating system on the client computer’s
desktop. The browser on the client machine seems to otherwise work fine on most
other websites. What could be likely causes of this problem? (Choose 2)
A. The browser’s binaries are corrupt
B. The client machine’s time zone is not set properly
C. The user has a virus-scanning program that is
blocking all secure cookies
D. The browser is set to refuse all cookies
E. The cookie uses characters that are discarded all
data from your server
Answer:
Answers A
and D both describe likely causes of this type of problem and warrant further investigation
on your part. Since the browser seems to work fine, it’s
unlikely that its binaries have suffered corruption such that only your site
has stopped working, and virusscanning programs do not normally stop secure
cookies selectively (although some block all cookies). On the other hand, the
browser might have been explicitly set to refuse all cookies, which is probably
the first source of trouble you should check for. By the same token, the computer’s time zone might have been set incorrectly and, since cookie
expiration dates are coordinated through GMT, cause the cookie to expire as
soon as it was set and never be returned to your scrīpts.
14. Assuming that the client browser is never
restarted, how long after the last access will a session“expire”and be subject to garbage collection?
A. After exactly 1,440 seconds
B. After the number of seconds specified in the
session.gc_maxlifetime INI setting
C. It will never expire unless it is manually deleted
D. It will only expire when the browser is restarted
E. None of the above
Answer:
The
session.gc_maxlifetime INI setting regulates the amount of time since the last
access after which the session handler considers a session data file“garbage”and marks it for deletion by the garbage handler. Once this has
happened, any subsequent access to the session will be considered invalid, even
if the data file still exists. Coincidentally, the session.gc_maxlifetime is
set to 1,440 seconds, but you can’turely on that number
as it might have been changed without your knowledge by the system
administrator. Answer B is, therefore, correct.
15. The ___________ function automatically transforms
newline characters into HTML <br /> tags
Your Answer: ____________________________
Answer:
This
identifies the nl2br function, which can be used precisely for this purpose.
note:We have completed work on this section and will begin next section 'Working with Arrays' next time. Enjoy it! Enjoy PHP!