You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2015/04/15 00:09:52 UTC

Getting the context's session-tracking URI parameter name

All,

I need to get the context's session-tracking URI parameter name from
within a Valve, and it looks like this is the right (static) call:

o.a.c.util.SessionConfig.getSessionUriParamName(request.getContext());

=2E.. but a quick reading of the code in there seems to reveal a
copy/paste error:

Starting on line SessionConfig.java:49

    public static String getSessionUriParamName(Context context) {

        String result =3D getConfiguredSessionCookieName(context);

        if (result =3D=3D null) {
            result =3D DEFAULT_SESSION_PARAMETER_NAME;
        }

        return result;
    }

At first, I would have imagined that there was some breakage in the
trunk due to some refactoring, but it appears that the code is the same
all the way back to Tomcat 7.

I haven't tested it (and will), but it looks like if a non-default
cookie name is used, that same name will be used for the URI parameter
as well.

Is that by mistake or by design?

Thanks,
-chris


Re: Getting the context's session-tracking URI parameter name

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Konstantin,

On 4/14/15 7:36 PM, Konstantin Kolinko wrote:
> 2015-04-15 1:09 GMT+03:00 Christopher Schultz <ch...@christopherschultz.net>:
>> All,
>>
>> I need to get the context's session-tracking URI parameter name from
>> within a Valve, and it looks like this is the right (static) call:
>>
>> o.a.c.util.SessionConfig.getSessionUriParamName(request.getContext());
>>
>> =2E.. but a quick reading of the code in there seems to reveal a
>> copy/paste error:
>>
>> Starting on line SessionConfig.java:49
>>
>>     public static String getSessionUriParamName(Context context) {
>>
>>         String result =3D getConfiguredSessionCookieName(context);
>>
>>         if (result =3D=3D null) {
>>             result =3D DEFAULT_SESSION_PARAMETER_NAME;
>>         }
>>
>>         return result;
>>     }
>>
>> At first, I would have imagined that there was some breakage in the
>> trunk due to some refactoring, but it appears that the code is the same
>> all the way back to Tomcat 7.
>>
>> I haven't tested it (and will), but it looks like if a non-default
>> cookie name is used, that same name will be used for the URI parameter
>> as well.
>>
>> Is that by mistake or by design?
> 
> 
> By design.
> 
> http://svn.apache.org/viewvc?view=revision&revision=r944920
> https://bz.apache.org/bugzilla/show_bug.cgi?id=49299

Perfect; thanks for the reference.

-chris


Re: Getting the context's session-tracking URI parameter name

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-04-15 1:09 GMT+03:00 Christopher Schultz <ch...@christopherschultz.net>:
> All,
>
> I need to get the context's session-tracking URI parameter name from
> within a Valve, and it looks like this is the right (static) call:
>
> o.a.c.util.SessionConfig.getSessionUriParamName(request.getContext());
>
> =2E.. but a quick reading of the code in there seems to reveal a
> copy/paste error:
>
> Starting on line SessionConfig.java:49
>
>     public static String getSessionUriParamName(Context context) {
>
>         String result =3D getConfiguredSessionCookieName(context);
>
>         if (result =3D=3D null) {
>             result =3D DEFAULT_SESSION_PARAMETER_NAME;
>         }
>
>         return result;
>     }
>
> At first, I would have imagined that there was some breakage in the
> trunk due to some refactoring, but it appears that the code is the same
> all the way back to Tomcat 7.
>
> I haven't tested it (and will), but it looks like if a non-default
> cookie name is used, that same name will be used for the URI parameter
> as well.
>
> Is that by mistake or by design?


By design.

http://svn.apache.org/viewvc?view=revision&revision=r944920
https://bz.apache.org/bugzilla/show_bug.cgi?id=49299

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org