You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bitstorm <gi...@git.apache.org> on 2018/09/16 20:50:04 UTC

[GitHub] tomcat pull request #122: Added a default value for ApplicationSessionCookie...

GitHub user bitstorm opened a pull request:

    https://github.com/apache/tomcat/pull/122

    Added a default value for ApplicationSessionCookieConfig#name

    By spec. javax.servlet.SessionCookieConfig#getName should return 'JSESSIONID' as default value (see https://docs.oracle.com/javaee/7/api/javax/servlet/SessionCookieConfig.html). 
    However, ApplicationSessionCookieConfig has no default value for this field and returns 'null' if not set. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bitstorm/tomcat trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tomcat/pull/122.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #122
    
----
commit 4d6a6a7131c742b1bb3e57414df268c4ecdf91a0
Author: Andrea Del Bene <an...@...>
Date:   2018-09-16T20:44:57Z

    Added a default value for ApplicationSessionCookieConfig#name

----


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by solomax <gi...@git.apache.org>.
Github user solomax commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    +1 no-one like NPE :)


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by bitstorm <gi...@git.apache.org>.
Github user bitstorm commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    To me specs are a little contradictory about this. They state that the default value is JSESSIONID but at the same time they allow to return a null if a custom value is not set for this parameter. Since ApplicationSessionCookieConfig already exposes a default value for max edge it would be nice to do the same for session cookie name and don't leave the responsibility for handling this situation to application code. 


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by bitstorm <gi...@git.apache.org>.
Github user bitstorm commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    @kkolinko 
    
    Thank you for the clarification! 


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by markt-asf <gi...@git.apache.org>.
Github user markt-asf commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    There is nothing in the spec that says Tomcat is required to do that.


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by kkolinko <gi...@git.apache.org>.
Github user kkolinko commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    The javadoc that you linked
    https://docs.oracle.com/javaee/7/api/javax/servlet/SessionCookieConfig.html
    says "Returns: [...] or null if setName(java.lang.String) was never called"
    
    Thus it documents null as the default value.
    
    BTW, the cookie name can be overwritten by sessionCookieName attribute on Context,
    http://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Common_Attributes


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by solomax <gi...@git.apache.org>.
Github user solomax commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    @markt-asf ping :)


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    There is also nothing that says not to do it. The question is which behavior is better.
    IMO returning the actual value that is in use is much better than `null`.


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by markt-asf <gi...@git.apache.org>.
Github user markt-asf commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    Closing the PR as the requested change is not correct.


---

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


[GitHub] tomcat pull request #122: Added a default value for ApplicationSessionCookie...

Posted by markt-asf <gi...@git.apache.org>.
Github user markt-asf closed the pull request at:

    https://github.com/apache/tomcat/pull/122


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    s/edge/age/


---

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


[GitHub] tomcat issue #122: Added a default value for ApplicationSessionCookieConfig#...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:

    https://github.com/apache/tomcat/pull/122
  
    The new question is "Should Tomcat call `#setName("JSESSIONID")` during start of an application (just after creation of `SessionCookieConfig`) ?" With the current behavior every application/framework should make checks for `null` and assume `JSESSIONID`.


---

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