Permalink
Browse files

Merge branch 'release/2.0.6'

  • Loading branch information...
benlucchesi committed Feb 10, 2013
2 parents dfe4e03 + 6f78b3f commit 7404fb95e11986b80e5d60d7d1ae2309034e4f55
@@ -25,7 +25,7 @@ import com.granicus.grails.plugins.cookiesession.ExceptionCondenser
import org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean
class CookieSessionGrailsPlugin {
- def version = "2.0.5"
+ def version = "2.0.6"
def grailsVersion = "1.2.4 > *"
def title = "Cookie Session Plugin" // Headline display name of the plugin
def author = "Ben Lucchesi"
View
@@ -1,7 +1,7 @@
# Cookie Session Grails Plugin
-Current Version: 2.0.5
+Current Version: 2.0.6
The Cookie Session plugin enables grails applications to store session data in http cookies between requests instead of in memory on the server. Client sessions are transmitted from the browser to the application with each request and transmitted back with each response. This allows application deployments to be more stateless. Benefits of managing sessions this way include:
@@ -39,7 +39,6 @@ edit grails/conf/Build.config and add the following line under the plugins closu
runtime ":cookie-session:2.0.5"
-
# Configuration
The following parameters are supported directly by the cookie-session-v2 plugin. Note, additional configuration is needed for webflow and large session support. See additional instructions below.
@@ -373,21 +373,21 @@ class CookieSessionRepository implements SessionRepository, InitializingBean {
private String[] splitString(String input){
log.trace "splitString()"
- def list = new String[cookieCount];
+ String[] list = new String[cookieCount];
if( !input ){
log.trace "input empty or null."
return list
}
- def partitions = input.size() / maxCookieSize
+ int inputLength = input.size()
+
+ def partitions = Math.ceil(inputLength / maxCookieSize)
log.trace "splitting input of size ${input.size()} string into ${partitions} paritions"
- (0..partitions).each{ i ->
- def start = i * maxCookieSize;
- def end = start + maxCookieSize - 1
- if( end >= input.size() )
- end = start + input.size() % maxCookieSize - 1
+ for (int i = 0; i < partitions; i++){
+ int start = i * maxCookieSize
+ int end = Math.min(start + maxCookieSize - 1, inputLength - 1)
list[i] = input[start..end]
}

0 comments on commit 7404fb9

Please sign in to comment.