Register and join over 40,000 other developers!
Recent Topics
-
Tekken 7
IsrealJones - Mar 22 2021 07:21 AM
-
How do I solve this problem on the days in months?
Kebblet - Dec 15 2020 03:51 PM
-
The Game You Are Waiting For?
WendellHarper - Dec 06 2020 01:21 PM
-
Quora and Reddit Backlinks
WendellHarper - Dec 06 2020 01:14 PM
-
DigitalServer.com.mx - Leading dedicated hosting & SSL Certificates in Mexico!
scriptcol - Sep 24 2020 10:06 PM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- python
- calculator
- sql
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

5 replies to this topic
#1
Posted 04 March 2008 - 08:30 PM
Hey guys, when i make things that need to be stored such as login information i write it to a session, I know you can also use cookies although i have never tried. For information such as user name and password wich is better to use the session or the cookie and why? thanks in advance

#2
Posted 04 March 2008 - 09:42 PM
Cookies are used for information that shall be saved for a long time on the client's computer, and they'll probably be active when you come to the website another time (I'm saying probably, because it depends on how long the cookie shall last)
Sessions do save information too, but only while the sessions lasts! If you quit the website, or close down the browser, the session will no longer be active.
Sessions do save information too, but only while the sessions lasts! If you quit the website, or close down the browser, the session will no longer be active.
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?
#3
Posted 04 March 2008 - 10:18 PM
Thanks. So it would probably be best to do sessions for log in information in case the person just exits the site withought loging out corect?

#4
Posted 05 March 2008 - 12:05 AM
One thing to note is that cookies can be altered by the user while sessions cannot. Thus if you intend on storing private/secure information, its probably best to do so in sessions and not cookies.
#5
Posted 05 March 2008 - 12:07 AM
ok thanks to both of you that answers my question complytly.

#6
Posted 05 March 2008 - 12:49 PM
Also, using sessions you can't enable the "remember me" function that automatically logs you in each visit.
Also tagged with one or more of these keywords: session
General Forums →
Mobile Development →
html5 web storage session loginStarted by mutago, 11 May 2014 ![]() |
|
![]() |
||
Language Forums →
PHP →
PHP Session VS. Session issetStarted by Serialcek, 31 Jan 2014 ![]() |
|
![]() |
||
General Forums →
General Programming →
Preventing Session Hijacking?Started by Pally, 20 Dec 2013 ![]() |
|
![]() |
||
Language Forums →
HTML, CSS and Javascript →
Passing PHP session variables to a Jquery/Ajax script.Started by elliottveares, 15 Oct 2013 ![]() |
|
![]() |
||
![]() PHP session set but not being detectedStarted by JakeWelton, 06 Oct 2013 ![]() |
|
![]() |
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download