Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Question about Sessions vs' Cookies

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Question about Sessions vs' Cookies

Postby Skeletor » Thu Feb 06, 2003 6:13 am

What I am going to play around with and make is a shopping cart app. I was debating using cookies or sessions to store their current items. I know sessions are more secure then cookies, but is there any other immediate advantages to using sessions over cookies? I imagine since they are stored on the server, access to them may be a bit quicker. *shrugs*

Also, is using sessions sound like a good idea for storing the shopping cart info that the user selects? I haven't made a cart app yet, so I was just wondering if sessions is the way to go.
Skeletor
New php-forum User
New php-forum User
 
Posts: 147
Joined: Tue Nov 19, 2002 7:47 am
Location: US, Ohio

Postby pootergeist » Thu Feb 06, 2003 9:54 am

I'd agree that sessions are a better bet than cookies for data that changes rapidly. They can be more secure too. Many of the programmers I know also store backup session data within the db which can be very helpful, 'specially if you have to port values between servers.
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby Redcircle » Fri Feb 07, 2003 2:44 am

also when using sessions the only cookie that is put onto the client side is the session id all other information resides on the server. Not only making it more secure but easier to work with.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Joan Garnet » Fri Feb 07, 2003 3:43 pm

Another good reason to use sessions is the fact that the user could have the cookies option disabled.
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby Redcircle » Sun Feb 09, 2003 12:45 am

also sessions are easier to use.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP coding => General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.