+ Reply to Thread
Results 1 to 5 of 5

Thread: [PHP] Sessions not working.

  1. #1
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    [PHP] Sessions not working.

    Alrgiht I've set up my login script which has set teh username and password session yet when I go to /cPanel/ it refuses to show me as logged in. Below is my code.

    login file:
    Code:
    $_SESSION['username'] = $username;
    $_SESSION['password'] = $Functions->Encrypt($password, $arrayUser->salt);
    THen in my config file I have
    Code:
    $usrLogin_query = $db->dbQuery("SELECT * FROM `" . DB_PREFIX .
        "users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" .
        $_SESSION['password'] . "';");
    $usrLogin = $db->dbFetch($usrLogin_query);
    At the bottom of the config file I have:
    Code:
    print_r($usrLogin);
    die();
    For debug purposes.

    Any help with this?

    When I visit the site it should have all my users information but it shows up blank.

    I also have session_start() at the top of configuration file.
    Last edited by Shadow121; 12-24-2008 at 04:07 PM.

  2. #2
    tttony's Avatar
    tttony is offline x10 Sophmore tttony is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    ~ 10°10'27.10''' N 67°59'59'.59''' O elev. 457m
    Posts
    147

    Re: [PHP] Sessions not working.

    try with session register()

    PHP Code:
    session_start();
    session register("your_session"); // this is deprecated but just try...
    $_SESSION["your_session"]; 
    http://ve.php.net/manual/en/function...n-register.php
    PHP & MySQL Web Developer
    Free Domain co.cc

  3. #3
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Re: [PHP] Sessions not working.

    Never mind. I used the wrong function for my sessions. was using ->salt instead of ['salt']
    Last edited by Shadow121; 12-25-2008 at 11:52 AM.

  4. #4
    tttony's Avatar
    tttony is offline x10 Sophmore tttony is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    ~ 10°10'27.10''' N 67°59'59'.59''' O elev. 457m
    Posts
    147

    Re: [PHP] Sessions not working.

    ah ok, is an object session
    PHP & MySQL Web Developer
    Free Domain co.cc

  5. #5
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Re: [PHP] Sessions not working.

    Meh. I forgot I switched my DBA class to array instead of object. I changed it, figured Hell I could probably switch it to object in the smarty templates too so I did and its all working fine now ;D

+ Reply to Thread

Similar Threads

  1. phpBB 3 not working after update
    By Patrick M in forum Free Hosting
    Replies: 2
    Last Post: 08-16-2008, 02:47 PM
  2. GD Library not working
    By freebking in forum Free Hosting
    Replies: 0
    Last Post: 08-12-2008, 06:32 PM
  3. Domain stopped working
    By devongovett in forum Free Hosting
    Replies: 1
    Last Post: 05-05-2008, 08:04 PM
  4. Subdomain not working
    By trogenhorse in forum Free Hosting
    Replies: 5
    Last Post: 04-28-2008, 10:57 AM
  5. ads are not working
    By rayminator in forum Free Hosting
    Replies: 5
    Last Post: 03-23-2008, 09:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers