It turned out that the session was being reset explicitly in a controller's action (got rid of that) and the cookies can't be set from hashes or sessions it seems (can't confirm that behavior). So the solution was to parse the desired data form the session into JSON objects and send them to the view, where I used JavaScript to repopulate the form using the JSON it received.
In the controller:
def index
# Conditionally store prepopulated form data from the session in some cookies
if session[:myData]
# Store the session data into instance variable and convert it to JSON
@myData = session[:myData].to_json
# Resetting session is optional
reset_session
end
end
In the view:
<% if @myData %>
<script type="text/javascript">
// Store values from the controller instance variables
// Need to call raw method so browser doesn't escape the quotation marks that exist in @myData (JSON object)
var myData = <%= raw @myData %>;
// Do something with you myData
</script>
<% end %>