[Ur] Redirecting to the same page with a form, getting "wrong cookie signature"

Daniel Patterson dbp at dbpmail.net
Sun Jul 28 15:56:45 EDT 2013


Yeah, it does - it sets a message in a cookie to be displayed on the
next page load (across the redirect). What happens when it posts is:

update database
set message in cookie
redirect to next page to be shown

Is this not permitted? Or what part of it could be going wrong?

Adam Chlipala <adamc at csail.mit.edu> writes:
> Do you expect the application to be changing a cookie value in between 
> the different steps in this scenario?  That's what the error message has 
> to do with, probably.
>
> On 07/28/2013 03:33 PM, Daniel Patterson wrote:
>> I have a form that is used for editing an entry. I want to be able to
>> both save the entry and continue editing and also save and return to the
>> index. Since multiple submit buttons aren't supported (how I would
>> normally implement this pattern), the solution I came up with was having
>> a checkbox for whether to continue editing, and then just redirect back
>> to the editing page.
>>
>> This works the first time - the entry is saved, and the edit entry page
>> loads again, but when I try to submit on this reloaded page, I get a
>> "Fatal error: Wrong cookie signature" error. The code that produces this
>> is at:
>>
>> form:   https://github.com/dbp/latinamerica/blob/master/la.ur#L236
>> submit: https://github.com/dbp/latinamerica/blob/master/la.ur#L309
>>
>> I know it isn't as simple as I describe, because I created a minimal
>> example of that and it works just fine. That example is here:
>>
>> https://gist.github.com/dbp/6099783
>>
>> But, I'm not sure what could be causing that error, so I'm not sure how
>> else to approach minimizing it.
>>
>> Any advice for either potential causes (to aid minimizing) or a reason /
>> fix for it would be great!
>>    
>
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20130728/1f8e9390/attachment.pgp>


More information about the Ur mailing list