Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2011
    Thanked 0 Times in 0 Posts

    Why do my phpBB sessions reset?

    I have a website in the root of my hosting package with my phpbb forum in the /forum directory.

    Here is the link to the site: http://www.alphakravmagainternational.com/index2.php

    Test the login with Username: testme , Pass: testme123

    I am attempting to establish a phpbb session on my website using the following codes:

    This code is included before the <HTML> of every page:

    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    // Start session management
    // check for logout request
    $cp = $_GET['cp'];
    // is it a logout? then kill the session!
    if ($cp == "logout") {
    echo "Successfully Logged Out.";
    My login form in the header of every page:

    // Page login notice
    if ($user->data['user_id'] == ANONYMOUS)
    <img src="forum/images/avatars/gallery/noavatar.png" style="float:left; width:72px; height:72px;">
    <div class="login">
        <form method="POST" action="forum/ucp.php?mode=login">
        <ul><li><span>Username:</span> <input class="loginfield" type="text" name="username" size="20"></li>
            <li><span>Password:</span> <input class="loginfield" type="password" name="password" size="20"></li>
            <li>Remember Me? <input type="checkbox" name="autologin"> &nbsp; &nbsp; &nbsp; <a href="forum/ucp.php?mode=register">Register</a></li>
            <li><input type="submit" value="Login" name="login"></li>
        <input type="hidden" name="redirect" value="index.php">
    } else { ?>
    <img src="forum/images/avatars/gallery/<?php echo $user->data['user_avatar']; ?>" style="float:left; width:72px; height:72px;">
    <div class="login">
        Welcome back, <?php echo $user->data['username_clean']; ?><br> 
        You have <?php echo $user->data['user_unread_privmsg']; ?> new messages<br>
        <a href="index2.php?cp=logout">Log Out</a>
    <?php } ?>
    It looks like I am able to log in, however, when I click to a different page the session is gone and I have to log in again. This happens when I click to the forum as well. I cant for the life of me figure this out and It's driving me crazy. Please help!

    Thank you for reading.

  2. #2
    Master Coder
    Join Date
    Feb 2011
    Your Monitor
    Thanked 614 Times in 600 Posts
    Phpbb is a very large and complex program. You won't get detailed support for it here however their own forums WILL be able to help you - goto their website and then register on their own forums and repost your question. No-one here will know phpbb in depth enough to help you I'm afraid.
    Quote Originally Posted by deathshadow View Post
    So seriously, loosen up that tie, let out the belt, and try relating to normal people on the street instead of the gentleman's club crowd.


Posting Permissions

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