ASP.NET passing values between redirect & postback
<p>First of all, thanks for reading.</p>

<p>I will describe my situation as explicitly as I can.</p>

<p>I have a page where users can leave comments.
Here's the commenting flow</p>

<ul>
<li>A-1. 'comment' button is clicked</li>
<li>A-2. a modal popup with a textbox is shown using ModalPopupExtender in ajaxtoolkit.</li>
<li>A-3. User types a comment in the textbox, and click "ok".</li>
</ul>

<p>However, when user is not logged in, expected behavior changes.</p>

<ul>
<li>B-1. 'comment' button is clicked</li>
<li>B-2. a Login modal-popup with id &amp; pwd textbox is shown.</li>
<li>B-3. User types ID &amp; pwd, and click ok.</li>
<li>B-4. Comment-modal-popup is shown</li>
<li>B-5. user types a comment and click ok.</li>
</ul>

<p><strong>I have a PROBLEM handing this case.</strong></p>

<p>When B-3 occurs, page is posted back, i log the user in, update session object, and I Response.Rediect() the page to itself to display correct logged-in status (i have to..).
After redirect, in Page_Load(), I need to check some values to show Comment-Modal-Popup.
But I'm not sure how..</p>

<p>Here's what i considered</p>

<ul>
<li>ViewState 
<ul>
<li>i just can't use it since the page was redirected not posted back.</li>
</ul></li>
<li>QueryString 
<ul>
<li>I could have add "showCommentPopup=1" on URL when redirecting, but that will leave unwanted QueryString in URL. I don't want users to misuse it.</li>
</ul></li>
<li>Session
<ul>
<li>I actually used Session object. Before redirection, I set Session[ "ShowCommentPopup" ] to true. In Page_Load() if it is set, i remove it and show the popup.</li>
</ul></li>
</ul>

<p>using Session like i did doesn't work correctly when user opens same page in multiple tabs.  </p>

<ol>
<li>user opens two tabs(in Firefox) with same URL</li>
<li>user follows steps from B-1 to B-3 in first tab.</li>
<li>before the page is redirected between B-3 and B-4, user refreshes second tab.</li>
<li>if the timing is right, comment-popup is shown in the second tab.</li>
</ol>

<p>I expect to hear great insights from stackoverflow..</p>
