This is a discussion on "are session safe?" within the PHP Forum section. This forum, and the thread "are session safe? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
are session safe?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
Hello, I've heard an awful lot about login systems that use sessions being vulnerable to XSS.
As the user can change sessions, if the session was storing the username/id of the person logged in, could they change it to access other peoples accounts? if so how can this be fixed? or is there another way besides sessions? thanks guyssssss
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|
|
#2
|
|||
|
|||
|
Re: are session safe?
You could store a random string in the session aswell as the username and update the database for the user when they log in. Then on every page check that the username and the key thing match... That's what I do anyways
It probably won't take long to go through all 27,000 with a program. But the hacker will have to know how the key is generated. Use you imagination |
|
#3
|
||||
|
||||
|
Re: are session safe?
could use salt or something i guess.
could you show me an example of your login script? is it something like:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#4
|
|||
|
|||
|
Re: are session safe?
Yeah, close.
But instead of
|
|
#5
|
||||
|
||||
|
Re: are session safe?
ahh right thanks
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#6
|
|||
|
|||
|
Re: are session safe?
No worries, glad to help
|
|
#7
|
||||
|
||||
|
Re: are session safe?
are there any other methods or things to add to this one?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#8
|
|||
|
|||
|
Re: are session safe?
Wow... Appears my way of stopping illegitimate users is just as bad as storing just the username.
Quote:
http://www.roscripts.com/Security_in...tions-174.html |
|
#9
|
|||
|
|||
|
Re: are session safe?
apparently storing the users user-agent on log in is a good way as well. (on each page match the user-agent on record with the one sent on the original login. Would take ages to hit a match by brute force!!)
Also regenerating the session id on login. |
![]() |
| Tags |
| sessions, users |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| List of Web Safe Browser Fonts ... | hmm213 | Web Page Design | 1 | Nov 30th, 2007 15:27 |
| Help with SESSION vars, please? | Donny Bahama | PHP Forum | 3 | May 28th, 2007 15:53 |
| Session Variables.... | courtjester | Classic ASP | 11 | Jul 6th, 2004 00:04 |
| session php | iamzoli | PHP Forum | 2 | Apr 7th, 2004 05:49 |
| Web Safe Colours | Smokie | Web Page Design | 17 | Sep 11th, 2003 22:10 |