#!bin/sh

# Unfortuneatly we can not reproduce the issue in a doctest so you will
# need to run this script instead.

# for number in 1 2 3 4 5 6 7 8 ;do sh sessionTest.sh ;done

URL="http://localhost:8080"

# Set the data for *user 1*
curl -s -D  user_one "${URL}/@@simpleFormDataSet.html"  > /dev/null

# Display the data for *user 1*
echo -n "Before: "; curl -b user_one "${URL}/@@simpleFormDataGet.html"; echo

# Set the data for *user 2* in a child process.
# Note: there is a 1 second sleep, so it should take a while.)
curl -s -D user_two "${URL}/@@simpleFormDataSet.html" > /dev/null &

# Get the data for *user 1*
# Note: We expect this to be the same as before, but it is empty sometimes.
echo -n "After:  "; curl -s -b  user_one "${URL}/@@simpleFormDataGet.html"; \
echo; echo
