Losing cookies after URL is rewritten

View: New views
5 Messages — Rating Filter:   Alert me  

Losing cookies after URL is rewritten

by Jim d-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm finding a problem where my cookies are apparently being set to
null I arrive at a page via a rewrite rule.  To be clear, I'm not even
sure this a problem with UrlRewriteFilter or my limited understanding
of cookies.  Anyway, I'm currently using UrlRewriteFilter 3.2.0 beta
on Tomcat 6.0.18 and my rule appears below:

    <rule>
        <note>redirect /main to the edit action on tsf pagefilter</
note>
        <from>/main/</from>
        <to>/servlet/Controller?action=10000&target=500</to>
    </rule>

The forward appears to work, but for some reason I'm not receiving any
cookies.  For example, when I go to:

   http://localhost/myapp/servlet/Controller?action=10000&target=500

Everything works just fine, and when I debug the server side I see my
cookie "appsessionid" being set properly.  However, when I go to:

  http://localhost/myapp/main/

My cookies aren't being set.  When I debug the app I can tell that my
querystring variables ('action' and 'target') are being properly set
but "appsessionid" is does not appear in my cookies collection.  It's
very possible that my web browser isn't even sending the cookie, but
either way I don't know why this may be happening.  Anybody have any
ideas?  Many thanks in advance --Jim d


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Losing cookies after URL is rewritten

by Avlesh Singh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Upgrading to the latest version fixed your issue. Right?

Cheers
Avlesh

On Thu, Oct 1, 2009 at 6:01 AM, Jim d <jim.devos@...> wrote:

I'm finding a problem where my cookies are apparently being set to
null I arrive at a page via a rewrite rule.  To be clear, I'm not even
sure this a problem with UrlRewriteFilter or my limited understanding
of cookies.  Anyway, I'm currently using UrlRewriteFilter 3.2.0 beta
on Tomcat 6.0.18 and my rule appears below:

   <rule>
       <note>redirect /main to the edit action on tsf pagefilter</
note>
       <from>/main/</from>
       <to>/servlet/Controller?action=10000&amp;target=500</to>
   </rule>

The forward appears to work, but for some reason I'm not receiving any
cookies.  For example, when I go to:

  http://localhost/myapp/servlet/Controller?action=10000&target=500

Everything works just fine, and when I debug the server side I see my
cookie "appsessionid" being set properly.  However, when I go to:

 http://localhost/myapp/main/

My cookies aren't being set.  When I debug the app I can tell that my
querystring variables ('action' and 'target') are being properly set
but "appsessionid" is does not appear in my cookies collection.  It's
very possible that my web browser isn't even sending the cookie, but
either way I don't know why this may be happening.  Anybody have any
ideas?  Many thanks in advance --Jim d





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Losing cookies after URL is rewritten

by Jim d-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Unfortunately not.  I'm using the 3.2.0 version currently available
from the front page of  http://tuckey.org/urlrewrite/.

It may simply be that the browser isn't sending the cookies in the
request, but I don't think my app is specifying a path scope for the
cookie,  so I assume that the client should be passing cookies for all
requests to that app, right?  Again, my understanding of cookies is a
bit fuzzy.


On Oct 1, 9:36 am, Avlesh Singh <avl...@...> wrote:

> Upgrading to the latest version fixed your issue. Right?
>
> Cheers
> Avlesh
>
>
>
> On Thu, Oct 1, 2009 at 6:01 AM, Jim d <jim.de...@...> wrote:
>
> > I'm finding a problem where my cookies are apparently being set to
> > null I arrive at a page via a rewrite rule.  To be clear, I'm not even
> > sure this a problem with UrlRewriteFilter or my limited understanding
> > of cookies.  Anyway, I'm currently using UrlRewriteFilter 3.2.0 beta
> > on Tomcat 6.0.18 and my rule appears below:
>
> >    <rule>
> >        <note>redirect /main to the edit action on tsf pagefilter</
> > note>
> >        <from>/main/</from>
> >        <to>/servlet/Controller?action=10000&target=500</to>
> >    </rule>
>
> > The forward appears to work, but for some reason I'm not receiving any
> > cookies.  For example, when I go to:
>
> >  http://localhost/myapp/servlet/Controller?action=10000&target=500
>
> > Everything works just fine, and when I debug the server side I see my
> > cookie "appsessionid" being set properly.  However, when I go to:
>
> >  http://localhost/myapp/main/
>
> > My cookies aren't being set.  When I debug the app I can tell that my
> > querystring variables ('action' and 'target') are being properly set
> > but "appsessionid" is does not appear in my cookies collection.  It's
> > very possible that my web browser isn't even sending the cookie, but
> > either way I don't know why this may be happening.  Anybody have any
> > ideas?  Many thanks in advance --Jim d
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Losing cookies after URL is rewritten

by Wim De Smet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Probably, as long as the requests use the same host.

On Thu, Oct 1, 2009 at 8:33 PM, Jim d <jim.devos@...> wrote:

>
> Unfortunately not.  I'm using the 3.2.0 version currently available
> from the front page of  http://tuckey.org/urlrewrite/.
>
> It may simply be that the browser isn't sending the cookies in the
> request, but I don't think my app is specifying a path scope for the
> cookie,  so I assume that the client should be passing cookies for all
> requests to that app, right?  Again, my understanding of cookies is a
> bit fuzzy.
>
>
> On Oct 1, 9:36 am, Avlesh Singh <avl...@...> wrote:
>> Upgrading to the latest version fixed your issue. Right?
>>
>> Cheers
>> Avlesh
>>
>>
>>
>> On Thu, Oct 1, 2009 at 6:01 AM, Jim d <jim.de...@...> wrote:
>>
>> > I'm finding a problem where my cookies are apparently being set to
>> > null I arrive at a page via a rewrite rule.  To be clear, I'm not even
>> > sure this a problem with UrlRewriteFilter or my limited understanding
>> > of cookies.  Anyway, I'm currently using UrlRewriteFilter 3.2.0 beta
>> > on Tomcat 6.0.18 and my rule appears below:
>>
>> >    <rule>
>> >        <note>redirect /main to the edit action on tsf pagefilter</
>> > note>
>> >        <from>/main/</from>
>> >        <to>/servlet/Controller?action=10000&target=500</to>
>> >    </rule>
>>
>> > The forward appears to work, but for some reason I'm not receiving any
>> > cookies.  For example, when I go to:
>>
>> >  http://localhost/myapp/servlet/Controller?action=10000&target=500
>>
>> > Everything works just fine, and when I debug the server side I see my
>> > cookie "appsessionid" being set properly.  However, when I go to:
>>
>> >  http://localhost/myapp/main/
>>
>> > My cookies aren't being set.  When I debug the app I can tell that my
>> > querystring variables ('action' and 'target') are being properly set
>> > but "appsessionid" is does not appear in my cookies collection.  It's
>> > very possible that my web browser isn't even sending the cookie, but
>> > either way I don't know why this may be happening.  Anybody have any
>> > ideas?  Many thanks in advance --Jim d
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Losing cookies after URL is rewritten

by Jim d-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Turns out I *was* setting a cookie path.  Apparently when you add a
new cookie to the servlet response it sets the cookie path to the same
path as the servlet, in this case "/servlet/Controller".  If I
explicitly set the cookie path to "/" it seems to work fine.

Anyway,  I think I'm fine now.  Apologies for the false alarm, but I
appreciate the help!








On Oct 2, 12:16 am, Wim De Smet <krom...@...> wrote:

> Probably, as long as the requests use the same host.
>
>
>
> On Thu, Oct 1, 2009 at 8:33 PM, Jim d <jim.de...@...> wrote:
>
> > Unfortunately not.  I'm using the 3.2.0 version currently available
> > from the front page of  http://tuckey.org/urlrewrite/.
>
> > It may simply be that the browser isn't sending the cookies in the
> > request, but I don't think my app is specifying a path scope for the
> > cookie,  so I assume that the client should be passing cookies for all
> > requests to that app, right?  Again, my understanding of cookies is a
> > bit fuzzy.
>
> > On Oct 1, 9:36 am, Avlesh Singh <avl...@...> wrote:
> >> Upgrading to the latest version fixed your issue. Right?
>
> >> Cheers
> >> Avlesh
>
> >> On Thu, Oct 1, 2009 at 6:01 AM, Jim d <jim.de...@...> wrote:
>
> >> > I'm finding a problem where my cookies are apparently being set to
> >> > null I arrive at a page via a rewrite rule.  To be clear, I'm not even
> >> > sure this a problem with UrlRewriteFilter or my limited understanding
> >> > of cookies.  Anyway, I'm currently using UrlRewriteFilter 3.2.0 beta
> >> > on Tomcat 6.0.18 and my rule appears below:
>
> >> >    <rule>
> >> >        <note>redirect /main to the edit action on tsf pagefilter</
> >> > note>
> >> >        <from>/main/</from>
> >> >        <to>/servlet/Controller?action=10000&target=500</to>
> >> >    </rule>
>
> >> > The forward appears to work, but for some reason I'm not receiving any
> >> > cookies.  For example, when I go to:
>
> >> >  http://localhost/myapp/servlet/Controller?action=10000&target=500
>
> >> > Everything works just fine, and when I debug the server side I see my
> >> > cookie "appsessionid" being set properly.  However, when I go to:
>
> >> >  http://localhost/myapp/main/
>
> >> > My cookies aren't being set.  When I debug the app I can tell that my
> >> > querystring variables ('action' and 'target') are being properly set
> >> > but "appsessionid" is does not appear in my cookies collection.  It's
> >> > very possible that my web browser isn't even sending the cookie, but
> >> > either way I don't know why this may be happening.  Anybody have any
> >> > ideas?  Many thanks in advance --Jim d
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---