Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
php cookies
Name: BigShow Date: October 26, 2008 at 11:40:40 Pacific OS: xp CPU/Ram: pentium 4 Product: dell
Comment:
Two part question here.
I am using cookies on a member site, i was told they are very hackable, i dont see how but i am told to use sessions. Can I get some opinions.
Second, if it set a cookie with php i assume i can always retrieve it with javascript correct?
Name: shutat Date: October 26, 2008 at 20:47:45 Pacific
Reply:
Here's an article on cookies versus sessions. For someone determined to hack, anything is possible no matter which you use.
For the second question, yes. However, the client could have js disabled, so keep that in mind.
HTH
0
Response Number 2
Name: Michael J (by mjdamato) Date: October 27, 2008 at 20:14:50 Pacific
Reply:
Cookies are stored on the client computer, so someone could simply open the cookie file on their PC and edit however they choose. Session data is stored on the server. However, there is a cookie stored on the client which identifies the session, but that is it - all session specific data is stored on the server.
Summary: <? setcook("name", "username") ?> well thats php way of doin cookies.... but where are they stored.. obviously not in cookies folder.. its just i used that form for my login script, only snag is so...
Summary: ok, heres the drill my site uses a php cookie login system, the cookie is called using the following code, which will also unclude the members login details to the page, for use in the php <? $cook...
Summary: I've never heard of a site that logs you out while you're using the site, but it is definitely possible. In addition to using an expiration on the cookie I would suggest using a timestamp as the value...