Commit Graph

55 Commits

Author SHA1 Message Date
Charlie Somerville
e9f9d05a94 pass digest as a key in an options hash 2013-08-27 20:51:18 +10:00
Charlie Somerville
06d4ca0254 establish a baseline by skipping all tests failing before 2.0.0 2013-08-06 17:41:45 -07:00
José Valim
d793a56121 Merged pull request #198 from robdimarco/2-3-stable.
Patch for issue 6440 - Session Reset undefined method `destroy' for {}:Hash
2011-04-28 00:37:53 -07:00
gmarik
b0be721dd9 respect :expire_after option
- it was broken after
[commit](e0eb8e9c65)
- there's also
[issue](https://rails.lighthouseapp.com/projects/8994/tickets/6634-railsrack-inconsistency-about-expires_afterexpires-cookie-option)

- also: maybe it worth making Rack understand :expire_after as we
duplicate same logic in [cookie_store](https://github.com/gmarik/rails/blob/v2.3.11/actionpack/lib/action_controller/session/cookie_store.rb#L114)

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-14 13:48:35 +02:00
Rob Di Marco
589ce09564 Unit test that shows calling reset session twice results in an exception 2011-02-28 22:53:36 -05:00
Pascal Friederich
e0eb8e9c65 Let Rack::Utils.set_cookie_header! create the Set-Cookie header instead of manually fiddling with the response headers [#4941 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-01 11:58:45 +01:00
W. Andrew Loe III
17f2fb44c0 Only send secure cookies over SSL. 2010-09-14 11:52:40 -07:00
Michael Lovitt
257a29d3cc Sessions should not be created until written to and session data should be destroyed on reset. [#4938 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-14 08:04:37 +02:00
Aaron Patterson
67e18c523c fisting Session::AbstractStore#clear to actually clear the session. [#5030 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-07-01 14:47:28 -07:00
Prem Sichanugrist
f8f365346e Make sure that Rails doesn't resent session_id cookie over and over again if it's already there [#2485 state:resolved]
This apply to only Active Record store and Memcached store, as they both store only the session_id, which will be unchanged, in the cookie.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-25 09:47:56 +02:00
Jesse Storimer
85b6d79d8a CookieStore should preserve the Set-Cookie header Array [#4743 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-22 11:25:32 -07:00
Joshua Peek
0c0da1a6e0 Fix empty Set-Cookie headers [#3811 state:resolved] 2010-02-02 08:53:16 -06:00
Jeffrey Hardy
bbaf3a04f5 CookieJar#delete should return the key's value, consistent with a Hash
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-14 11:51:11 -07:00
Joshua Peek
c73cf7d2c0 Revert "Only save the session if we're actually writing to it [#2703 state:resolved]"
This reverts commit 14edaa104d.
2009-05-30 09:36:32 -05:00
Johan Sörensen
14edaa104d Only save the session if we're actually writing to it [#2703 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-28 09:32:16 -05:00
Joshua Peek
c91912700d just kill brittle test 2009-03-24 10:52:49 -05:00
Joshua Peek
0706de4301 Better error message to try to figure out why the CI build is failing 2009-03-15 23:41:47 -05:00
Joshua Peek
367049cae6 Fix brittle Time.now mock 2009-03-15 23:17:31 -05:00
Joshua Peek
224a534400 reset_session should force a new session id to be generated [#2173] 2009-03-09 22:46:03 -05:00
moro
b6c8379834 Expected cookie value should also be escaped.
Ruby 1.9 compat for test.

[#1965 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-21 21:11:50 -08:00
Mike Gunderloy
b1d41bdfb0 Remove space from the test name [#1953 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-02-12 17:47:52 +01:00
Joshua Peek
524d8edf68 Update bundled Rack for Ruby 1.9 spec changes 2009-02-07 16:18:09 -06:00
Joshua Peek
2277fbedbe Temporarily bundle Rack 1.0 prerelease for testing 2009-02-07 00:08:28 -06:00
Joshua Peek
43c09383ce Ensure session id is set in session options hash [#1880 state:resolved] 2009-02-06 23:16:58 -06:00
Mike Gaffney
1b79683171 Deprecation tests for f17c876 [#1801 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-29 19:37:38 -06:00
Pratik Naik
2ae8d3079b Session cookie header should always be set if :expire_after option is specified 2009-01-28 05:05:48 +00:00
Cody Fauser
c090e5e075 Restore cookie store httponly default to true. Remove extraneous dup of options on initialization [#1784 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-20 11:50:43 -06:00
Frederick Cheung
d7b6e48c70 Fix randomly failing cookie store tests
Marshal.dump(Marshal.load(marshaled_hash)) is not guarenteed to be equal to marshaled_hash
because of the lack of ordering of hash
2008-12-26 18:25:03 +00:00
Matt Bauer
7b249b67e9 Fix reset_session with lazy cookie stores [#1601 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-20 14:37:51 -06:00
Lourens Naude
3ff6b00ee3 Persistent session identifier support for CookieSessionStore and API compat. with the server side stores [#1591 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-18 11:33:53 -06:00
Joshua Peek
ed70830713 Switch to Rack based session stores. 2008-12-15 16:33:31 -06:00
Joshua Peek
31ce92f7b5 Use autoload instead of explicit requires for ActionController 2008-11-23 16:35:47 -06:00
Michael Koziarski
04d2d043ca Move the cookie store to use the MessageVerifier class.
This removes support for ancient cookie-store generated cookies which were double escaped.
2008-11-23 16:42:15 +01:00
Jeremy Kemper
0be5bc3f59 Work around ruby 1.9 segfault 2008-11-07 21:50:39 -05:00
Pelle Braendgaard
7ecb9689b0 Added support for http_only cookies in cookie_store Added unit tests for secure and http_only cookies in cookie_store
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1046 state:committed]
2008-09-17 13:20:16 +02:00
Tarmo Tänav
656f0e7c6c Fix file permissions
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-07-31 16:36:23 -05:00
David Heinemeier Hansson
6573f6a4bc Revert "Lazy load cache and session stores"
This reverts commit 19895f087c.
2008-06-12 19:52:33 -05:00
Pratik Naik
19895f087c Lazy load cache and session stores 2008-06-10 10:29:25 +01:00
Rich Cavanaugh
a425cd1473 Don't double-escape cookie store data. Don't split cookie values with newlines into an array. [#130 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-05-12 15:26:19 -07:00
Tobias Lütke
fef82759ff Implement increment/decrement on cache storage engines, using read/write by default and using atomic command on memcache 2008-04-29 15:12:47 -04:00
Jeremy Kemper
7324444344 Ruby 1.9 compat: cookie store delete sets nil value instead of empty string
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8589 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-07 08:12:03 +00:00
Jeremy Kemper
9d755f1983 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +00:00
Michael Koziarski
ec93d61fb9 Make sure that cookie sessions use a secret that is at least 30 chars in length. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-21 21:31:45 +00:00
Jeremy Kemper
86a9c212c0 Skip memcache tests unless it's installed
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 01:47:35 +00:00
Jeremy Kemper
6e56cc013f Wrap test with uses_mocha
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-14 22:54:28 +00:00
Jeremy Kemper
d0df7f2b12 Memcached sessions: add session data on initialization; don't silently discard exceptions; add unit tests. Closes #9823.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-14 20:46:06 +00:00
Jeremy Kemper
d2ed32d592 Parse url-encoded and multipart requests ourselves instead of delegating to CGI.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6764 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 06:24:50 +00:00
Jeremy Kemper
f8273e4309 Shine some sunlight on the CGI extensions. Remove unused CGI#session.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 00:08:05 +00:00
Jeremy Kemper
bbcfb9b625 Cookie session store: ensure that new sessions doesn't reuse data from a deleted session in the same request.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6424 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-14 11:33:10 +00:00
Jeremy Kemper
5219aa9008 Cookie session store: raise ArgumentError when :session_key is blank.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-13 20:44:16 +00:00