[Agavi-Users] Agavi and .htacces file Session Issue using RewriteBase /

24 views
Skip to first unread message

Rafael Guerrero

unread,
Apr 6, 2013, 7:46:10 PM4/6/13
to us...@lists.agavi.org

After create a project form wizard, go to de test url defined on my local apache

go to de php session save path folder 
i can see that after execute request php create  multiple (often 2 files) session files

i try the same example using standar php session ( without agavi ) and php
only create a one session file for each client conection


counter session example

on agavi:

public function getDefaultViewName()
{
$user = $this->getContext()->getUser();
$var = $user->getAttribute('var', null, 0);
echo $var;
$var ++;
$user->setAttribute('var', $var);
return AgaviView::NONE;
}

after 6 request i get 9 session files:


ls -lsh
total 36K
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_8o5nc6a10j5bs28oeqh82uksp3
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_d8ovm1n4csr2m2l52otgpoqfq0
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_foaouq0dv5tnjos89n7uhvcuk7
4,0K -rw------- 1 www-data www-data 192 abr  6 18:41 sess_js31b6kmn8ujs7aj2r1e677a23
4,0K -rw------- 1 www-data www-data 192 abr  6 18:52 sess_jt065d5jmrpj7iq9q5fcupluj6
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_qe5t5v3jpmvg7lb98g1k7rkan5
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_ro9029gglsnusi96ipuglpmoj7
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_sinmo7f3l78rg2i8timnaicd31
4,0K -rw------- 1 www-data www-data 256 abr  6 18:55 sess_vg6o8u7cf3mcahsp2pcumlub36


php old school using the same .htaccess reply the same error

session_start();

$var = isset($_SESSION['var]) ? $_SESSION['var]  : 0;

echo $var;

$var ++;

$_SESSION['var] = var;


But, i remove .htaccess file and the error was not reply
using php old school example.

or 
When i try agavi or php old school example with the next url using the current .htaccess file on

i updated htacces file 

RewriteBase /example/


What is the error in: .htaccess file or apache config or php config
for using .htaccess agavi generated file on domain basepath /




On linux and Windows get the same error
i reply the error on
agavi 1.0.7 
apache 2
php 5.3.10
Ubuntu 12.04
Debian Lenny
Windows 7 profesional

thanks for your help

sorry for my english

--
Atte
Rafael Ángel Guerrero Godoy

David Zülke

unread,
Apr 12, 2013, 6:41:40 AM4/12/13
to Agavi Users Mailing List
I think what's happening here is that your browser is trying to access http://yourhost/favicon.ico and a few other files that browsers routinely request from servers.

But because that file doesn't exist, Apache sends the request to Agavi, which tries to process it, starts a session, realizes there is no route for "favicon.ico" and throws a 404 error.

Check your Web Inspector or Firebug or another debug console first, to see what requests are being made.

The same can also happen for images. It's probably best to change the rewrite rules so calls to img/, js/, css/ and so forth are never sent to Agavi, even if the requested file does not exist.

Hope that helps,

David
> _______________________________________________
> users mailing list
> us...@lists.agavi.org
> http://lists.agavi.org/mailman/listinfo/users

Reply all
Reply to author
Forward
0 new messages