Take it from someone who's been detained three times.
The only saving grace in situations like these is to remain calm—and while each time I was allowed to pass through, it hasn't been without completely incident. Even if it's the worst kind of luck, patience is a saving grace and the only way to make it through.
The golden and most important rule in regards to being detained is to not lie to immigration or customs officers. Don't do it even if you know it could ruin your chances of entering the country. Officers have access to sensitive information, and the power to deport and blackball you from a country for the rest of your life. That's not something I'd take lightly. This is where services such as a uscis reschedule appointment can come in very handy.
Being calm is perhaps the best thing to do for everyone.
If you are immediately affected by current events
It is best that all travelers from Iraq, Syria, Sudan, Iran, Somalia, Libya and Yemen are paying attention. The Council on American-Islamic Relations has posted the following information on Facebook to assist anyone who might be affected.
(Map Happy is currently having this information reviewed by an immigration lawyer.)
If you do plan to travel back to the U.S., you should fill out a USCIS G-28 form first that officially appoints an attorney to represent you in immigration situations and have that completed form with you as you board your flight.
The refugee program is being halted immediately, for at least 120 days. This will mean that anyone, anywhere in the process, will not move forward. The effort to resettle Syrian refugees in the U.S. is being halted indefinitely.
OTHER INFORMATION:
If you are non-citizen, green card holder (lawful permanent residents), from one of the seven countries named [Iraq. Syria, Sudan, Iran, Somalia, Libya and Yemen], and you are already inside the U.S., plan to delay all international travel for at least 90 days. If you leave, you are likely to be denied re-entry.
If you are a non-citizen from one of the seven countries named, and you are OUTSIDE of the U.S., you will face issues at the airport upon attempting to re-enter the US.
If you are asked to sign an I-407 at the airport or border, do not sign it; ask for the supervisor who handles LPR admissions. If you sign it, you will be giving up your green card.
Please keep looking for updates in the coming days to assess your travel options. If you are facing an emergency at the airport or are returning to the U.S. in the coming days, please have our numbers on hand (CAIR National: 202.488.8787)
Going through secondary screening
Secondary screening is a nice word for being detained. Immigration officers are allowed to pull passengers off for any reason they deem necessary. Most of the time it is strictly protocol and innocuous, but there are times when it could lead to something more.
It goes without saying but secondary screening is NOT the time for sarcastic, witty remarks or backtalk. This is the time to be the best version of yourself: Don't play with your phone. In many cases, you won't even be allowed to use it: Turn it off and pay attention to what is going on. Answer any questions officials may have truthfully.
(Please don't hide anything: Immigration officers have access to all personal records even if they are expunged. Even if you are in a foreign country, don't think this lets you off the hook: Canada has been known to share records with the U.S. in the same database. Expunged records are only relevant to private individuals and/or organizations.)
Have the proper paperwork ready. Make sure you have valid travel documents and visa such as h1b, tourist, student, etc. Being prepared is so, so important. Even proper documentation won't save you sometimes, as we're seeing. Despite having official company letterhead for a business trip once, I was still questioned for several hours, belongings searched, phone and computer turned on for any evidence to the contrary that I was not speaking the truth.
Missing a connecting flight because of extra screening
Thankfully, the airline is responsible for getting you to your destination at no extra cost. If anything, remember that.
Several years ago, on a connection from Toronto to Houston, it became alarmingly clear I was going to miss the last flight of the day during secondary screening. So, freaked out as I was, I politely approached an immigration officer and inquired to what might happen if I missed the flight. Be polite.
It is also reasonable to ask the officers if an airline representative can be notified about the situation, so alternative arrangements can be made or to hold the flight for several minutes.
The officers ended up expediting the screening process and sent two customs officers to accompany me through TSA, jumping me to the front of the security line (as I ran) to ensure I made my flight.
I only made that flight because they held the plane.
If things go south—and you end up in jail or rejected/deported.
Thankfully I haven't been deported yet, though the former has happened due to a large, LARGE legal misunderstanding. I'd prefer not to go into details, but I can offer suggestions.
Deportation is not a laughing matter. Many years ago, a friend was rejected at the Hong Kong border after a trip to mainland China (on a visa run). The immigration officials quickly sussed out she had been living there illegally, thanks to her arrival/departure records. The only way she could move out of her apartment was by having people move it out of her apartment for her, as we sent it back to her in boxes.
In some cases, and especially with one-way tickets, the airline will flag the ticket. Because the airline and/or the government has to assume the cost of deportation and the return airline ticket first, it's not uncommon that the airline might ask the offending traveler(s) to sign and agree that they will assume the financial burden and/or any accompanying fines.
(If I remember correctly, several years ago, a United gate agent once told me if I was rejected at the Hong Kong border, I would be liable for the ticket back plus a $10,000 fine.)
If the cost is assumed, don't assume this lets you off the hook financially. In some cases, it means being on the hook with the government, who, remember, can restrict a passport.
Being behind bars is definitely no laughing matter. However it happens, for whatever reason, the most important thing is to stay calm, DO NOT talk back, and do whatever you can to speed the process of getting out. Sometimes there is nothing you can do, except control your behavior, since that's what will ultimately expedite or hinder the process.
I wish I had a better answer for that, but I don't. I also wish I had a better answer for why refugees are being stopped from entering the country, but I don't. And it breaks my heart.