If you are already using PHP sessions, then there is no need for mod_session. PHP supports changing the session store: session_set_save_handler<http://www.php.net/session_set_save_handler> For an example solution, see http://phpsecurity.org/code/ch08-2
- Y On Tue, Apr 29, 2014 at 1:05 AM, Билгүүн Ө <bilguu...@statebank.mn> wrote: > First, thank you for response. > > I’m apologize for about the asking question on comment section. > > And I try to store php session in MySQL then configure Load Balancing. If > I can’t store session in DB, I think our server will get single point of > failure. We have a many php websites and these all using php session. > > Is there any module that possible to sync php sessions. > > > > *From:* Yehuda Katz [mailto:yeh...@ymkatz.net] > *Sent:* Tuesday, April 29, 2014 12:27 PM > *To:* users@httpd.apache.org > *Subject:* Re: [users@httpd] Question > > > > mod_session_dbd and php $_SESSION have nothing to do with each other and > php has its own session management system. > > > > If you can better explain what you are trying to do, someone might be able > to give you a recommendation for whether to use mod_session or php session. > > > > Also, the Comments section on the Apache manual > pages<http://httpd.apache.org/docs/trunk/mod/mod_session_dbd.html#comments_section>is > NOT for asking questions like this. Please don't do it again. > > > > - Y > > > > On Tue, Apr 29, 2014 at 12:14 AM, Билгүүн Ө <bilguu...@statebank.mn> > wrote: > > *From:* Билгүүн Ө [mailto:bilguu...@statebank.mn] > *Sent:* Tuesday, April 29, 2014 12:03 PM > *To:* 'users-...@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 > > > > [image: line] > > Хүндэтгэсэн > > Ө.Билгүүн > > Системийн администратор > > МТ Системийн хэлтэс > > > > Мэйл хаяг | bilguu...@sbank.mn; bilguu...@statebank.mn > > Вэб хуудас | www.statebank.mn > > > > [image: state-logo] > > *Танд санхүүгийн үйлчилгээг эрсдэлгүй хүргэнэ.* > > > > >