Skip to content

Commit

Permalink
Merge branch 'release/2.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
benlucchesi committed Feb 10, 2013
2 parents dfe4e03 + 6f78b3f commit 7404fb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CookieSessionGrailsPlugin.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import com.granicus.grails.plugins.cookiesession.ExceptionCondenser
import org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean import org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean


class CookieSessionGrailsPlugin { class CookieSessionGrailsPlugin {
def version = "2.0.5" def version = "2.0.6"
def grailsVersion = "1.2.4 > *" def grailsVersion = "1.2.4 > *"
def title = "Cookie Session Plugin" // Headline display name of the plugin def title = "Cookie Session Plugin" // Headline display name of the plugin
def author = "Ben Lucchesi" def author = "Ben Lucchesi"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@


# Cookie Session Grails Plugin # 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: 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:


Expand Down Expand Up @@ -39,7 +39,6 @@ edit grails/conf/Build.config and add the following line under the plugins closu


runtime ":cookie-session:2.0.5" runtime ":cookie-session:2.0.5"



# Configuration # 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. 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.


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -373,21 +373,21 @@ class CookieSessionRepository implements SessionRepository, InitializingBean {
private String[] splitString(String input){ private String[] splitString(String input){
log.trace "splitString()" log.trace "splitString()"


def list = new String[cookieCount]; String[] list = new String[cookieCount];


if( !input ){ if( !input ){
log.trace "input empty or null." log.trace "input empty or null."
return list 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" log.trace "splitting input of size ${input.size()} string into ${partitions} paritions"


(0..partitions).each{ i -> for (int i = 0; i < partitions; i++){
def start = i * maxCookieSize; int start = i * maxCookieSize
def end = start + maxCookieSize - 1 int end = Math.min(start + maxCookieSize - 1, inputLength - 1)
if( end >= input.size() )
end = start + input.size() % maxCookieSize - 1
list[i] = input[start..end] list[i] = input[start..end]
} }


Expand Down

0 comments on commit 7404fb9

Please sign in to comment.