You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Билгүүн Ө <bi...@statebank.mn> on 2014/04/29 06:14:47 UTC
[users@httpd] Question
From: Билгүүн Ө [mailto:bilguun.u@statebank.mn]
Sent: Tuesday, April 29, 2014 12:03 PM
To: 'users-faq@httpd.apache.org'
Subject: Question
Dear everyone
I'm trying to use mo_session_db, but i cant. I'm using mysql-14.14, apache-2.4.9 and php-5.5.11.
I create database named session_db, and table named SESSION which created by query CREATE TABLE SESSION ( id VARCHAR(32) NOT NULL COMMENT 'Stores the Session ID', access INT(10) UNSIGNED NOT NULL, data TEXT, PRIMARY KEY (`id`) ) ENGINE=INNODB ROW_FORMAT=DEFAULT;
My mod_session_dbd.conf is:
Session On
SessionDBDCookieName session path=/
SessionDBDCookieRemove Off
SessionDBDPerUser On
SessionDBDDeleteLabel deletesession
SessionDBDInsertLabel insertsession
SessionDBDSelectLabel selectsession
SessionDBDUpdateLabel updatesession
DBDriver mysql
DBDParams "host=<ip address x.x.x.x/localhost>, port=3306, user=root, password=<password>, dbname=session_db"
DBDExptime 300
DBDPrepareSQL "delete from SESSION where id = %s" deletesession
DBDPrepareSQL "update SESSION set data = %s, access = %lld, id = %s where id = %s" updatesession
DBDPrepareSQL "insert into SESSION (id, access, data) values (%s, %lld, %s)" insertsession
DBDPrepareSQL "select data from SESSION where id = %s and (access = 0 or access > %lld)" selectsession
DBDPrepareSQL "delete from SESSION where access != 0 and access < %lld" cleansession
I tested by store the session but it could not store in sql. My test pages are:
#index.html
<form action="session.php" method="get">
Value:<input type="text" name="view"/>
<input type="submit" value="Submit"/>
</form>
#session.php
session_start();
if(isset($_GET['view']))
{ $_SESSION['view'] = $_GET['view'];
echo "Saved in SESSION<br/>";
echo "<a href=link.php>Link</a><br/>";
echo "<a href=index.html>Back</a>";
}
else
{ echo "Could not save in SESSION<br/>";
echo "<a href=index.html>Back</a>";
}
#link.php
session_start();
if(isset($_SESSION['view']))
{ echo"Session: ". $_SESSION['view']."<br/>";
echo "<a href=clear.php>Clear cookie</a><br/>";
}
else
{ echo "There is no cookie<br/>"; }
#clear.php
session_start();
if(isset($_SESSION['view']))
{ unset($_SESSION['view']);
echo "cookie cleared<br/><br/>";
}
else{ echo "there has not been saved cookie<br/>"; }
Is there any problem in my config or testing pages. Sorry for my bad english
line
Хүндэтгэсэн
Ө.Билгүүн
Системийн администратор
МТ Системийн хэлтэс
Мэйл хаяг | bilguun_u@sbank.mn; bilguun.u@statebank.mn
Вэб хуудас | www.statebank.mn
state-logo
Танд санхүүгийн үйлчилгээг эрсдэлгүй хүргэнэ.