Displaying 20 results from an estimated 40000 matches similar to: "Reading cookies - weird problem"
2006 Mar 13
3
validates_associated problem
Hello,
I have a situation where an ''employee'' belongs to a ''department'' and
have setup the relationship as follows.
class Employee < ActiveRecord::Base
belongs_to :department, :foregin_key => "department_id"
validates_associated :department_id
end
class Department < ActiveRecord::Base
has_many :employees
def validate_on_update
2006 Jan 11
0
Cookies, models and nil objects
Still new in my ROR walk, been busily coding on a game application as a
fruitful exercise in becoming proficient in Ruby/ROR. However, I seem to
have hit a speed bump and am befuddled over some exhibited behavior in
ROR.
1. **Cookies** - on page 312 of the AWDwR book by DT and DHH, it states
that if you create a cookie by assigning a value to cookies[name], you
get a "default set of
2006 Apr 18
1
''depot''app, trouble with session / cookies
Many of you probably know the ''depot'' app from the ''Agile Rails
development'' book.
When the view changes from ''Store'' to ''display_cart,'' a session
containing the shopping-cart (:cart) is supposed maintain the ''cart''
between calls, but when the display_cart stub view shows up, I have
always ZERO elements
2006 Apr 03
0
Cookies and functional tests
Hi there
Is there any way that my functional tests can check to see if the
controller has set a cookie?
I''ve got this in a controller action;
def login
cookies[:foo] = ''bar''
end
Using a web browser, I can see that the cookie is being set when the
action is invoked. But, a functional test like this;
def test_cookie
assert_equal nil,
2006 Nov 24
0
Maybe a bug in Cookie:cookies
Hi man,
Thank you very much for your good work.
I think there may be a bug in Mechanize 0.6.3. Cookie:cookies (cookie.rb:L83
)
@jar[domain].each_key do |name|
=> if url.path =~ /^#{@jar[domain][name].path}/
if @jar[domain][name].expires.nil?
cookies << @jar[domain][name]
elsif Time.now <
2008 Jun 24
1
cross domain cookie
My rails server runs on localhost. I want to set a cookie for the
domain ".myapp.com". How do I do this?
(i tried cookies[''xyz] = {:value => ''abc'' ,:domain => ''.myapp.com''} .
It doesnt work. No cookie is being set when i specify domain like
that.
thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this
2006 Jun 16
0
rake spec controller test output hideus.
Is there any way to change the output of rake spec fails?
The errors are just totally over the top ugly and not helpful. First
of all the ruby -Ilib line always comes before each test and I find it
distracting. But if an error occurs on something that is not nil it
just gives me the entire contents of that object and that is no small
matter when the object is a HTTP request response.
Here is
2006 Feb 19
0
Re: can store array or hash in cookies?
Not a bug. A cookie is just a string. You can turn anything into a
string and store it in a cookie. Something very simple like the
following might work for you:
array_for_cookie = [1,4,5,7]
cookies[:foo] = array_for_cookie .to_s
array_from_cookie = cookies[:foo][1..-2].split('','')
(And if you are just storing a single integer in a cookie be sure to
turn it into a
2003 Oct 12
0
idea (and patch): connection cookies
I have an idea for a protocol extension to limit the exposure of the
complex crypto code in ssh servers. It's like tcp-wrappers, but based
on a secret token rather than IP address.
Patch against openssh-3.7.1p2:
http://nick.cleaton.net/openssh-cc-0.03.patch
Details
=======
The "Connection Cookies" mechanism is an unofficial ssh protocol
extension designed to prevent attackers
2010 Nov 14
1
RCurl and cookies in POST requests
Hello.
I know that it's usually possible to write cookies to a cookie
file by removing the curl handle and doing a gc() call. I can do
this with getURL(), but I just can't obtain the same results with
postForm().
If I use:
curlHandle <- getCurlHandle(cookiefile=FILE, cookiejar=FILE)
and then do:
getURL(http://example.com/script.cgi, curl=curlHandle)
rm(curlHandle)
gc()
it's
2006 Jan 10
0
problem with cookies in tests (TDD)
The problem I''m having is that I can''t seem to destroy the cookies and
assert that they were indeed destroyed inside the test.
The code to do this does work - the cookies are created, and are
destroyed when this is done in a browser, but I can''t seem to make the
test pass.
account_signup_test.rb
def test_should_pass_if_logout_destroys_cookie_data
post :login,
2008 Jun 06
7
Attention Judofyr: Broken cookies in 2.0
Hey Judofyr! Fix this! When someone sets a cookie using
@cookies.something = ''data'' it should be set with the path going to
the camping app''s root, not with no path, otherwise only that
controller with the same parameters will ever see the cookie again!
Please change this code:
> @cookies.each do |k, v|
> @response.set_cookie(k, v) if o[k] != v
> end
2006 Jul 08
0
Testing cookies - integration tests
Hello,
I''m trying to test some cookie code with some integration tests, but I''m
not sure if this is possible.
Currently I''m creating a session (using open_session) running some code
that sets my cookie and this works fine, the cookie is being set. Now
cookies are supposed to exist across different sessions, so I try to
create a new session (again with
2007 Jan 29
2
rspec and cookies
Hello
can anyone tell me how to test cookies using rspec? specifically, I''d like
to be able to set a cookie before a get/post request and also to test the
cookies which have been set by a get/post request
I know I can use cookies[:name] = ''value'' to set a cookie but how would I
set expiry information on such a cookie? when i try to pass a hash {:value
=>
2006 Mar 09
4
cross domain cookies
Does anybody know how to access the domain of a cookie from inside rails?
I am try to integrate phpbb forums into my site and one of the things phpbb
does is store a cookie. The forums are at forums.domain.com and the site is
www.domain.com so i needed to set the cookie domain in phpbb to just be
".domain.com" so both sites can access it. The trouble is when using
cookies[] in rails,
2001 Nov 15
2
X11 cookies and forwarding
I'm guess I wasn't following the whole cookies discussion completely
(putting cookies in /tmp to avoid putting them on NFS, etc.), but I
noticed today that with 2.9.9p2, if I use "ssh -X" to start a shell on the
server, in that shell XAUTHORITY is set to /tmp/ssh-XXXXXXXX/cookies and
there are cookies placed there there. These are the "fake" cookies for
the
2007 Mar 19
0
cookies
How do I set cookies in a spec so I can see them in my controller, please?
Conversely, why doesn''t this work...
require File.dirname(__FILE__) + ''/../spec_helper''
class TestApplicationController < ApplicationController
def index
@seen = cookies[''auth_token''] || ''NOT seen!''
puts cookies.inspect #
2008 May 17
4
Setting cookies in service overloader thingo
I''m implementing a simpler version of the Cookie Session Store in
Rails 2.0. If you know what that is, skip the next paragraph.
A cookie session store stores the session data inside cookies, on the
client, and signs them using a secret string, hashed together. The
user can decode the cookie easily if they know much about computers
and see what''s inside, but they
2012 Mar 08
0
Safari Version 5.1.3 (7534.53.10) Browser problem --- removing cookie on OS X Lion 10.7.3 (11D50b) when still valid
Hi All,
Hope this note helps the newbies to Rails
As I''m new to Rails, I''d like to share how I tracked down Safari''s
dropping of my cookie.
My Applebug no: 11003492 registered 7 March/2012
My development platform:
MacPro running rails 3.1.1 on OS X Lion 10.7.3 (11D50b)
Problem:
Firefox worked as programmed but switching to Safari my
current_user_token kept in the
2006 Dec 01
2
Mongrel 0.3.18, rails 1.1.6 and cookies
I''ve run into an issue with my rails application being unable to
properly set cookies on Mongrel 0.3.18. If I run the simplified code
below in Mongrel 3.14.4, both cookies are properly sent to and saved
by the browser. With the same code in 0.3.18, only the auth_token
cookie is created (if I switch them, only the userid as it will only
properly create the first cookie in the list.)