Displaying 20 results from an estimated 100000 matches similar to: "Best way to cookie a user?"
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 Mar 07
0
Re: Hash in a Cookie?
Actually, the first case here doesn''t work at all. I get
cookies[:cities] = [] # a blank array?
So, it looks like the cookies methods don''t allow Hashes...
On 3/7/06, Josh on Rails <rails@thewehners.net> wrote:
>
> In the second case (cities), this DOES work:
>
> cookies[:cities] = @params[:cities]
>
> BUT, creates a this-session-only cookie. Trying
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 <
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 Jan 27
3
Problem setting multi-value cookie
I''m trying to set a multi-value cookie but for some reason it''s not
working. Any help would be appreciated.
cookies[:user] = { :value => {:email=>params[:login][:email],
:passwd=>params[:login][:passwd]}, :expires => 30.days.from_now, :path
=> "/login"}
--
Thiago Jackiw
2020 Jul 20
1
Re: [PATCH nbdkit v2] curl: Implement header and cookie scripts.
On 7/15/20 3:53 PM, Richard W.M. Jones wrote:
> This rather complex feature solves a problem for certain web services
> that require a cookie or token for access, especially one which must
> be periodically renewed.
>
> For motivation for this feature see the included documentation, and
> item (1)(b) here:
>
>
2007 Mar 30
7
Some additional attacks on Cookie Session
Aside from the replay attacks discussed, there are some other attack
vectors on the cookie_session store.
I appreciate (and admire!) Jeremy''s good humor on all of this:
> Planting the seed here led to quick ripening and plenty of pesticide.
> Thanks for the fish, all.
>
> jeremy
Anyway, here''s what we came up with:
1. Brute Force
SHA512 can be computed _very_ fast.
2006 Apr 28
3
persistent cookies
hello,
I am trying to implement a "remember be" box for logins, however I cant
seem to get it to work. I have tried the following 2 methods but neither
seem to work. When i check the expiry time in firefox it always says "end
of session".
What is the proper way to handle this so the session cookie "_session_id"
doesnt expire for a year?
I tried
2007 Feb 05
2
adding a cookie
hi there,
I''m not sure if it is better to use the ml or the forum so I ended to
post on both ...
I''m trying to login into a page that is using javascript to set a cookie:
<script language="JavaScript"> {text "\n" " \n" " \n" " document.cookie
= ''vhp_js=v995105608h85339294p;path=/;domain=.venere.com;expire=0'';
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.)
2012 Apr 25
8
showing error (gsub) when switching from session to cookies
I am newbie to rail. Trying to develop social networking site so working
with railspace application. Everything is working fine but I stuck in
the problem when i am giving the authorization tocken to the user to
remember him/her.
My Error and controller code is below
Error:-
private method `gsub'' called for 4:Fixnum
C:/Users/Amir/Downloads/IR/ruby/lib/ruby/1.8/cgi.rb:342:in
2010 May 28
1
cookie has key/value pairs and lost order after JSON decode
If a cookie has several items, and is encoded as JSON text as the value
of the cookie, the order is actually apparent in the cookie''s text
But if JSON.decode is used:
ActiveSupport::JSON.decode(cookies[''item_list''])
and the result is actually in a hash, then the ordering is lost...
Is it true that if the original JSON object has an array of hashes (1
key and 1
2007 Aug 17
1
Cookie Sessions in Merb?
I like the cookie sessions that Rails edge has - they make sense,
they''re fast, easy.
For those that don''t know: the default session mechanism is to give
developers a Hash called session. To store this object between
requests it Marshals the session object and sends the object itself
(now as a bitstream) back to clients to store in their cookie file. To
prevent users from
2006 Mar 06
2
Cookies & gsub ?
I''m looking to store the current params into a/some cookie(s).
This works:
@params.each_pair do |this_index, this_param|
cookies[this_index] = this_param
end
Except, I get session-only cookies. This doesn''t work:
@params.each_pair do |this_index, this_param|
cookies[this_index] = {
:value => this_param,
:expires => 30.days.from_now
}
end
2020 Jul 15
0
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
This rather complex feature solves a problem for certain web services
that require a cookie or token for access, especially one which must
be periodically renewed.
For motivation for this feature see the included documentation, and
item (1)(b) here:
https://www.redhat.com/archives/libguestfs/2020-July/msg00069.html
---
plugins/curl/nbdkit-curl-plugin.pod | 142 ++++++++++++
2006 Sep 06
1
Problem changing cookie expiration
I''m trying to set the cookie expiration in my environment.rb file but I
keep getting a syntax error on WeBRICK startup. I''m trying both of the
ways listed in
http://wiki.rubyonrails.org/rails/pages/HowtoChangeSessionOptions. FYI
I''m new to rails so this is probably easy.
1) ActionController::Base.session_options[:session_expires] =
Time.local(2008,"jan"))
2007 Oct 04
2
newbie question with login form
hi,
i''m just starting to work with this incredible tool...
but i got a first problem with the login process
i''m logging on my app like this :
------
@agent = WWW::Mechanize.new { |a| a.log = Logger.new("mech.log") }
@agent.user_agent_alias = ''Mac Safari''
@page = @agent.get("http://myappAdress/")
@form = @page.forms.first
2006 Jan 11
9
Prototype & Cookies
Has anyone written any "cookie" class using prototype?
Basically, what I am looking for is if there is an easy way to store mutiple cookies in a single cookie using hash or something - easy writing and retrieval (updating the cookie value).
For eg -
If I had 25 cookies for my domain 5 of the cookies would either get dropped or not be set (as there is a limit of 20 cookies per domain).
2006 Jan 07
2
can store array or hash in cookies?
Hi
According to rdoc: value - the cookie''s value or list of values (as an
array).
So, I can use arrays, briliant.
But.... It does not work (at least on webrick)
I wrote a controller:
def check_cookies_first
cookies[:chef] =
{:value => ["first", "second"], :expires => Time.local
(2020)}
render_text ":)"
end
def
2006 May 24
1
Authentication between Instiki and Mailman Solved!
Basically, we needed to authenticate against the cookie written by Ruby.
It turns out that you can write a cookie for the entire TLD of
*.example.com from Instiki (Rails). So, I changed the cookie writing
code in the wiki_controller to the following.
# app/controllers/wiki_controller.rb
cookies[''ldap_username_2006''] = {:value =>emailaddress,
:expires