Web Servers on Unix and Linux - SESSION problems with mod_rewrite

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > September 2006 > SESSION problems with mod_rewrite





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SESSION problems with mod_rewrite
mihailokg@gmail.com

2006-09-26, 1:32 am

Hi all,

I tried to find solution for the code bellow but for now I did nothing.
Please if somebody know solution, post it here.

Thanks guys

When I logged in to the site and go to the page using a link or typing
the URL of the fake subdomain example: http://subdomain.domain.com, my
session dissapeared. Everytime I go to
the page even I am logged in, I was logged out or not totally logged
out because when i go back to the page without the subdomain, i was
logged in again.

Seems like using the subdomain my session dissapeared but the session
is there when i go back to the page without the subdomain.

I am using this code for .htaccess file

RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteCond %{HTTP_HOST} ([^.]+)\.domain\.com
RewriteRule ^$ http://www.domain.com/page.php?subdomain=%1 [L]

This works but there are no sessions created earlier.

If I put at the end of last line [R,L] page works but new URL is
http://www.domain.com/page.php?subdomain=subdomain and I want to stay
subdomain.domain.com and sessions to be visible.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com