Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After logging in, I still can't see a protected page #33

Open
jonteohr opened this issue Nov 20, 2016 · 4 comments
Open

After logging in, I still can't see a protected page #33

jonteohr opened this issue Nov 20, 2016 · 4 comments

Comments

@jonteohr
Copy link

After logging in with correct credentials and I'm redirected to the first page after login; it says I'm not authorized..

My protected page:

<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
 
sec_session_start();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Secure Login: Protected Page</title>
        <link rel="stylesheet" href="styles/main.css" />
    </head>
    <body>
        <?php if (login_check($mysqli) == true) : ?>
            <p>Welcome <?php echo htmlentities($_SESSION['username']); ?>!</p>
            <p>
                Testing
            </p>
            <p>Return to <a href="index.php">login page</a></p>
        <?php else : ?>
            <p>
                <span class="error">You are not authorized to access this page.</span> Please <a href="index.php">login</a>.
            </p>
        <?php endif; ?>
    </body>
</html>
@keyzi-danalexandru
Copy link

this happends to me too

@thryb
Copy link

thryb commented Dec 5, 2016

I find out the sec_session_start(); isn't working properly.

If you only use session_start(); instead the page is working fine.

Trying to figure out what is the issue, if I find a fix I will post here.

@thryb
Copy link

thryb commented Dec 5, 2016

Actually, check previous issue, it is explained why there.
#29

@tkrebs2
Copy link

tkrebs2 commented May 18, 2017

only using session_start(); does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants