FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Cookies - Sessions





imagefree
What way of storing info do u prefer? PHP Cookies or sessions.
Please discuss in reference to reliability, security, usefulness, and limitations of these features.
Also give any recommendations regarding this.


Thanks
DanielXP
Im not sure.

With sessions it only seems to last until the browser has been closed.
But with cookies any one can change them easily.

I guess theres loads of advantages and disadvantages for using both.
alalex
I usually use for logins and user management both. There is a user login php script that I've found to be the best around, check it out, in evolt.org

It is very easy to customize and it creates both a cookie and session vars to handle users and other data, making it a very safe way to manage them...
rvec
don't know what the ebove script does. But I think the best way would be to use sessions and store the id in the cookie if the user wants to stay logged in for a longer time.
DanielXP
rvec wrote:
don't know what the ebove script does. But I think the best way would be to use sessions and store the id in the cookie if the user wants to stay logged in for a longer time.


Not just their id if they want to stay logged in. all i have to do is change that number and im into someone else's account. use both id and password. (that wasy i need to know the password for that id otherwise i can login to it)
rvec
DanielXP wrote:
rvec wrote:
don't know what the ebove script does. But I think the best way would be to use sessions and store the id in the cookie if the user wants to stay logged in for a longer time.


Not just their id if they want to stay logged in. all i have to do is change that number and im into someone else's account. use both id and password. (that wasy i need to know the password for that id otherwise i can login to it)

you can't really guess that id. It's not like a 4 random number string. And a lot of sites put the id in the url, that's even less secure than in a cookie.
manav
both are secure if used properly though personally i prefer sessions cause it is compatible with browsers whose users have turned off the cookies :->
snowboardalliance
imagefree wrote:
What way of storing info do u prefer? PHP Cookies or sessions.
Please discuss in reference to reliability, security, usefulness, and limitations of these features.
Also give any recommendations regarding this.


Thanks


Both.
Sessions are good for short term stuff, but cookies are good to allow users to stay logged in.
Related topics
Sessions
PHP: Sessions and Cookies
PHP Sessions
FireFox and Cookies/Sessions
Password Protecting a webpage
what is better? Sessions or Cookies
Sessions
phpBB sessions
Cookies?
Disclaimer Redirection with cookies/sessions?
Passing a variable to multiple pages...sort of?
Sessions & cookies - member no longer active question
PHP Cookies - Problems
Creating safe persistent login system
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.