Activity Stream
48,167 MEMBERS
6845 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member

    Default [PHP] Session's secure

    Hello,
    I am currently making something in PHP,and I have login and It works with Sessions,I saw attack called 'Session Hijacking' so I'll ask you if this vulnerable to 'Session Hijacking'.
    So,I check if username & password is equal to username & password in database if yes it gives it $_SESSION['username'] = $username and $_SESSION['AdminId'] = 1.
    PHP Code: 
    <?php
    $username 
    mysql_real_escape_string($_POST['username']);
    ....
    if (
    $row 0) {
    $_SESSION['username'] = $username;
    $_SESSION['AdminID'] = 1;
    }
    ?>
    Now in other file I check sessions:
    PHP Code: 
    <?php
    if(!empty($_SESSION['username']) and $_SESSION['AdminID'] == 1) {
    echo 
    "Logged in!";
    } else {
    echo 
    "Not logged in!";
    }
    ?>
    Thanks in advance, k0d3.
    Nedim! Reviewed by Nedim! on . [PHP] Session's secure Hello, I am currently making something in PHP,and I have login and It works with Sessions,I saw attack called 'Session Hijacking' so I'll ask you if this vulnerable to 'Session Hijacking'. So,I check if username & password is equal to username & password in database if yes it gives it $_SESSION = $username and $_SESSION = 1. <?php $username = mysql_real_escape_string($_POST); .... if ($row > 0) { $_SESSION = $username; $_SESSION = 1; } Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Session hijacking us nothing to do with the section of the session your working on

    to prevent session hijacking see me other post: http://www.besthostingforums.com/showthread.php?t=44270
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  4.     
    #3
    Member
    k,Thank you litewarez.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need RDP/VPS admin session
    By SABRINE in forum Hosting Discussion
    Replies: 0
    Last Post: 30th Oct 2012, 10:47 AM
  2. [help] Detect session on URL
    By jomasaco in forum Web Development Area
    Replies: 4
    Last Post: 28th Apr 2011, 05:20 PM
  3. Session Hijacking
    By litewarez in forum Web Development Area
    Replies: 17
    Last Post: 24th Aug 2010, 10:54 PM
  4. T20 WorldCup Betting Session
    By -saMmy- in forum Useful Sites
    Replies: 26
    Last Post: 21st May 2010, 02:11 AM
  5. Webcam session with To0 :P
    By CyberJ37 in forum General Discussion
    Replies: 40
    Last Post: 22nd Dec 2009, 09:20 AM

Tags for this Thread

BE SOCIAL