httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Билгүүн Ө <bilguu...@statebank.mn>
Subject RE: [users@httpd] Question
Date Tue, 29 Apr 2014 05:05:53 GMT
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:yehuda@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, Билгүүн Ө <bilguun.u@statebank.mn> wrote:

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

Танд санхүүгийн үйлчилгээг эрсдэлгүй хүргэнэ.­

 

 


Mime
View raw message