Jump to content

$_SESSION and security


Lodius2000

Recommended Posts

so I have my login page that once a valid username is compared to the users in the database it writes that user to $_SESSION['username'], how do i go from simply writing a username into a session, to making that session into something that is required to display pages below the login page, say for altering or creating a blog post.

 

would it just be something like

 

<?php
session_start();

if ($_SESSION['username']){
     display_page();
} else {
     print '<a href="login.php">Login first dummy</a>

 

or something more complicated?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/107713-_session-and-security/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.