[eluser]Grim[/eluser]
Hey all started using CI a few weeks ago, and is swapping out old code with it :-) But a small snag I've hit is that before I used to have a PHP file called startsession.php which is called on every page to start the session and set vars if there is cookies available.
Code:
<?php
session_start();
// If the session vars aren't set, try to set them with a cookie
if (!isset($_SESSION['user_id'])) {
if (isset($_COOKIE['user_id']) && isset($_COOKIE['username'])) {
$_SESSION['user_id'] = $_COOKIE['user_id'];
$_SESSION['username'] = $_COOKIE['username'];
}
}
?>
So I have a controller named auth and have a function called auto_login which does the same thing but how do I call it on every page ?
Sorry If its a little redundant :blank:
Thanks In Advance :-)