Is it possible to get SQL Injection with this code:
session_start();
$id = session_id();
$logged=mysqli_fetch_array(mysqli_query($dbbase, "SELECT id,user FROM sess WHERE id='".$id."'"));
Do I need to validate $id variable and escape special characters?
Recently I found something in the php error logs: PHP Warning: session_start(): The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in ... .
Maybe you have any suggestions how I can prevent that?