Search the Community
Showing results for tags 'cookies'.
-
On page 516 script 16.9: Line 20: setcookie (session .... //DESTROYS COOKIE This line destroys a cookie set earlier (that was set in login.php? or in the Header?) However I cannot find the corresponding cookie that was set. The value, i see, is PHPSESSID thank you Also, is it always necessary to set a cookie when using a Session?
-
Probably a very silly question to a knowledgeable person, but still: I know nothing should be sent to a browser before header() is sent there. I also know that nothing should be sent to a browser before a cookie is set. What if I need a header AND a cookie on the same page? Would they interfere with each other? Should a cookie be set before a header, or vice versa? Thanks in advance for your help!
-
I had some trouble with the steps on pages 366-367 when setting cookies. What was happening ( I think ) is that the following code (step 7 & 8) was looking for the id of the target: var target = e.target || e.srcElement; //The timer code here didn't effect my results, but was sitting between the problematic code var expire = new Date(); expire.setDate(expire.getDate() + 7); COOKIE.setCookie('theme', target.id, expire); setTheme(target.id); However if a cookie was already set, and you use getCookie('theme') to retrieve it, your value is a string. So the fix I came up wi
-
In the Chapter 13 web app, cookies are used to verify if a person has administrator access. It seems that using a cookie is similar to a password in the way that in the book, Larry says to set a cookie with sort of a random name and value. For instance, don't set a cookie with the name of 'login' and the value of 'true' (instead a cookie named Samuel is set with a value of Clemens). But, because cookies are easily viewed once they are set, for example using firebug on firefox, it seems like this is not the best method for veirifying who has access to a site and who doesn't. For exa
- 5 replies
-
- chapter 13
- cookies
-
(and 1 more)
Tagged with:
-
I am having trouble getting my scripts to work when it coes to sessions without cookies. I have amended the login.php script as per the book and then amended the remaining scripts header.html, loggedin.php and logout.php as described in the book but find when entering a valid email address and password I am returned straight to the index.php page. Please can you assist me in understanding what I am doing wrong, I have been trying to work through it and resolve it my self for the last 2 days. I have MySQL Server 5.5, php 5.3.6 and Windows 7 Home 64bit running on my own computer using the loc