Mod Rewrite and Session handling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Mod Rewrite and Session handling

Robert Gan
This post was updated on .
Hey guys,

i have the following problem:

I use sometimes CMS to show content. The CMS hyperlink I modify with Apache mod rewrite like:

user types in: domain.tld/content/somecontent.html
apche mod rewrite sends to ofbiz: domain.tld/ecommerce/control/cms/content/somecontent

It works, that I get shown the content, but I loose the session, so ofbiz creates a new cookie / session. When I directly type the correct ofbiz url, than the session is the same as before, and everything works fine.

Do anyone has an idea how I can fix it?

thanks in advance

Edit: I forgot to tell, that I use the apache frontend to the tomcat app server with proxy pass (mod_proxy_ajp)
Reply | Threaded
Open this post in threaded view
|

Re: Mod Rewrite and Session handling

Jacques Le Roux
Administrator
You might be interested by http://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa, just a bet

Also, if you are not usint it, you could try mod_proxy_ajp
https://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-ApacheHTTPD(ApacheWebserver)

Jacques

From: "Robert G." <[hidden email]>

> Hey guys,
>
> i have the following problem:
>
> I use sometimes CMS to show content. The CMS hyperlink I modify with Apache
> mod rewrite like:
>
> *user types in:* domain.tld/content/somecontent.html
> *apche mod rewrite sends to ofbiz:
> *domain.tld/ecommerce/control/cms/content/somecontent
>
> It works, that I get shown the content, but I loose the session, so ofbiz
> creates a new cookie / session. When I directly type the correct ofbiz url,
> than the session is the same as before, and everything works fine.
>
> Do anyone has an idea how I can fix it?
>
> thanks in advance
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Mod-Rewrite-and-Session-handling-tp4638721.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Mod Rewrite and Session handling

Robert Gan
Hey Jacques,

thank you for your help. I allready use mod_proxy_ajp, cause it was for me the easiest way to frontened apache.

The QSA Option after the rewrite rules does not help unfortunately.

To more specify my chain:

Apache conf:
ProxyRequests Off
<Proxy *>
        AddDefaultCharset off
        Order deny,allow
        ALlow from all
</Proxy>

ProxyVia On




<VirtualHost *:80>
        ServerName localhost
        ServerAdmin gan@mercon24.de

        ProxyRequests Off
        ProxyPreserveHost On
        proxyPass / ajp://localhost:8010/

        RewriteEngine On
        RewriteRule ^/(images/.+);jsessionid=\w+$ /$1 [PT]
        RewriteRule ^/?inhalt/(.+)\.html$ /shop/control/cms/inhalt/$1 [PT]
</VirtualHost>


Problem: The browser loose the session cookie or expire the session after entering a rewritten url (call of TLD/inhalt/XXX.html lets the session expirering). The website behind this url (real url: TLD/shop/control/cms/inhalt/XXX is correctly shown.

In the case that I call the ofbiz url directly (TLD/shop/control...) than the session does not expire, everything is fine.

Hopefully anyone has an idea how to fix it.

thanks in advance, Robert





Reply | Threaded
Open this post in threaded view
|

Re: Mod Rewrite and Session handling

Robert Gan
does someone has any idea?