 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
tb323
Joined: 12 Dec 2006 Posts: 2 Location: Sweden
|
Posted: Wed Dec 13, 2006 2:03 pm Post subject: Auth and HTTP_Session with DB-container |
|
|
I've already posted this in the HTTP section but since they are related I hope I'm not breaking any rules by posting it here as well.
I've made a simple login page with the Auth-package on one page pretty much like in the documentation:
-------------------------
<?php
require_once "Auth.php";
function loginFunction()
{
/*
* Change the HTML output so that it fits to your
* application.
*/
echo "<form method=\"post\" action=\"test.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$options = array(
'dsn' = "mysql://user:password@localhost/database",
);
$a = new Auth("DB", $options, "loginFunction");
$a->start();
if ($a->checkAuth()) {
header('location:http:\\www.domain.com\page.php');
}
?>
---------------------------------
When the user logs in he is transfered to another page that checks again if he is authorized. All fine to this point, but then I want to use a new HTTP_Session to store some data in a database like this..
---------------------------------
HTTP_Session::useTransSID(false);
HTTP_Session::useCookies(true);
HTTP_Session::setContainer('DB', array('dsn' => database_Dsn(),'table' => 'tbl_sessiondata'));
HTTP_Session::start('mySession');
HTTP_Session::setExpire(time() + 300); // set expire to 300 seconds
HTTP_Session::setIdle(time() + 5); // set idle to 5 seconds
-----------------------------------
The problem is that I get this error message and I have no idea how to solve it.. :
Warning: session_module_name(): A session is active. You cannot change the session module's ini settings at this time.
Is it possible to run an Auth session together with a HTTP_Session on the same page? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|