PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



Session fixation

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General
View previous topic :: View next topic  
Author Message
abalfazl



Joined: 15 Feb 2005
Posts: 68

PostPosted: Thu Jul 24, 2008 9:19 pm    Post subject: Session fixation Reply with quote

I think that the best way is that you save session ID in database and check if any session ID duplicate,send a warning for admin and regenerate session ID,It is the best way.

say we have a database that session ID of each user is saved there.

When a hacker steals session ID of another user and enter the site,Then there will be two same session ID in database

Does it make sense?

of course, It is said that it is possible prevent this attack by a token:
[PHP]
<?php $token = md5(uniqid(rand(),TRUE)); $_SESSION['token'] = $token; ?>[/PHP]


One comment about that code is:
Via the URL or POST yes. It doesn't prevent session hijacking, it simply makes it harder because it's one extra piece of information you need. You're effectively passing an authentication token around in all requests... which would be fairly easy to sniff.


But I don't understand...

Please explain for me,I disturb,

We create a session ID and a token for a User ,Then token is in session array with a special session ID.
A hacker steals Session Id of user and enters the site,

Now what would happen next?Can a hacker find the token?

I think Token is saved in server and do not transfer through the Network. Right?

Then How a hacker can access the to the token?
Back to top
View user's profile Send private message
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum