#80 ✓wontfix
Kyle Cross

Need a way to get a cookie

Reported by Kyle Cross | December 2nd, 2008 @ 11:37 AM

I need a way to get a cookie ie: get_cookie

Comments and changes to this ticket

  • Bryan Helmkamp

    Bryan Helmkamp December 2nd, 2008 @ 03:00 PM

    Kyle -- What are you trying to do? Are you using Rails or Merb?

  • Kyle Cross

    Kyle Cross December 2nd, 2008 @ 03:34 PM

    • Tag changed from cookie to cookie, featurerequest

    Bryan, I am using Rails and I am trying to find out if a cookie exists. I am currently workng on converting watir tests to webrat test. I work with Gaffo and we have found that Watir does not work well for the automated application that we are using, it tends to hang at times and causes many errors when it does. Some of the tests we have test to see if there is a cookie set. For user acceptance I need this same functionality Kyle

  • gaffo

    gaffo January 6th, 2009 @ 02:35 AM

    • State changed from “new” to “wontfix”

    Kyle, We've thought about this on the team and have discussed it in IRC quite a bit. The consensus seems to be that a user doesn't really care if they have a certain cookie set, but they do care about what that cookie causes to happen for them. For example, setting a login cookie would have a section saying "Welcome, Username" instead of saying "Please Register/Login".

    So I'm going to mark this as wontfix unless we come up with some other compelling reasons.

  • thelucster (at gmail)

    thelucster (at gmail) February 13th, 2009 @ 03:40 PM

    I'm having some issues, and I think I need this too.

    The behaviour I want to test is that when a user logs in, and they visit the site again later (i.e. when the session has expired) they are automatically logged in.

    On my application when you login you are remembered for that period via the session, and permanently by using cookies. This is automatic. When a user logs out their session is destroyed, as well as the cookie.

    As I can't destroy the session how can I test this, other than by testing whether the cookie exists?

  • Steve

    Steve September 12th, 2009 @ 03:19 PM

    I agree with what thelucster is saying. This is particularly useful for verifying a login cookie has been set or destroyed. I realize the premise of user acceptance testing is to verify things that the user can see. If you think about it, that's what the cookie is. It's something we're giving directly to the user. Will all users go and look at their cookie store? No, probably not. There is also no way I can verify a cookie has been set by looking at my database or some such.

    I don't think that webrat should go into anything crazy like trying to persist cookies across webrat sessions or anything. I do think that it would be good to be able to read cookies set by the site, as well as manually set cookies to check various scenarios.

  • Sebastian
  • JT Olds

    JT Olds January 20th, 2011 @ 03:58 PM

    • Milestone order changed from “0” to “0”

    signed up for an account to post this

    i'm looking for a way to test that session fixation is not something my rails app is vulnerable to. the test should make sure the cookie session id is different after log in than before log in.

    it's too bad webrat has explicitly wont-fix-ed this, or i would have used webrat. instead, still looking.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

Referenced by