RewriteRule and $_COOKIE[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there a problem by working between RewriteRules and $_COOKIEs[]?

In my specific case, i have a permalink activation control. When it's
OFF, and the website sections are called through
index.php?id_section=5, the cookies inside index.php are saved
correctly.

When i turn the permalinks option ON
(http://www.mysite.com/contact_us/support/ .. which is id_section=5),
the cookies are some-how saved, but the php script ignores their
value.

Some has a solution for this?

 BTW, it might help if you check the file contents:

.htaccess: *****************
RewriteEngine on
#Languages
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(_([A-Za-z]{2}))/?$ /index.php?l=$2 [L]
RewriteRule ^(.*)/_([A-Za-z]{2})/?$ /index.php?l=$2 [L]
# Sections
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ /index.php [L]

index.php ********************

if ($_GET['l']) {
# querystring (some checking here...)
$lang = strtolower($_GET['l']); }
} elseif($_COOKIE['l']) {
# cookies (some more checking here...)
$lang = $_COOKIE['l']; }
}
if (!$lang) { $lang = $config['lang']['default']; }
# lang cookie
setcookie('l', $lang, time()+$config['lang']['exp']);



bye
andres


--
Slds,
Andrés Santos, IIG

*****************************
cel: (593) 9 7026627
http://www.egobits.com
*****************************


PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux