Results 1 to 5 of 5

Thread: PHP Problem: User won't stay logged in.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    95

    PHP Problem: User won't stay logged in.

    On my member system located at: http://lukeidiot.com/vip
    It will let you login and it say's "Thanks for logging in: 'Username'."
    But when you try to goto the "Control Panel" it says "You need to be logged
    in to do this.

    Now I know this isn't an error in the coding of the script because the previous
    php member script I used did the same thing. Any idea on why this is happening?

    Thanks Futurely.

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: PHP Problem: User won't stay logged in.

    do you have session_start() on the top of the page?
    My usual boring signature: Something

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    95

    Re: PHP Problem: User won't stay logged in.

    Quote Originally Posted by dclamp
    do you have session_start() on the top of the page?
    Yeah, it says "ob_start();" which i believe means the same as "session_start();".
    I get this error in my sites Cpanel's "Error Log":
    Code:
    [Fri Sep 14 13:37:23 2007] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/wwwluke/public_html/vip/index.php:4) in /home/wwwluke/public_html/vip/members.php on line 144

  4. #4
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: PHP Problem: User won't stay logged in.

    no. ob_start starts output buffering. You need session_start which will start the session.
    My usual boring signature: Something

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: PHP Problem: User won't stay logged in.

    It would help to see your code in order to debug it. It sounds like you are not properly setting your session or cookie variables (depending on what method you are using).

    Can you post the same code that sets up these variables?
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width