Forums

ASP

This topic is locked

creating a session

Posted 18 Oct 2007 18:19:05
1
has voted
18 Oct 2007 18:19:05 Javier Castro posted:
Hi Guys, this must be very simple but I am struggling to figure it out. Please help.
I have a page that when it loads, receives data from a SSL page on another server. In the background it collect the data and mails it to user and admin. That's what I want.
The problem: if the page gets refreshed the email is sent again. If page user presses the back button, then emails again.
I thought that when page loads I can check if there is a session, if there is nothing then sends email and creates a session. Then When page is refreshed I can check if there is session and not email again.

Any ideas as to how to do that, samples???? help please..... BTW: using classic ASP

Replies

Replied 19 Oct 2007 11:12:54
19 Oct 2007 11:12:54 Georgi Kralev replied:
Hi Javier,

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>I thought that when page loads I can check if there is a session, if there is nothing then sends email and creates a session. Then When page is refreshed I can check if there is session and not email again.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

This could be accomplished with the following sample code
&lt;%
<i>'Check if Session is Initialized</i>
<b>If Not</b> Session("initsession" <b>Then</b>
Session("initsession" = True

<i>'Do your work:
'Collect the data and mails it to user and admin</i>

<b>End if</b>
%&gt;

I hope this helps you.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 20 Oct 2007 07:28:43
20 Oct 2007 07:28:43 Javier Castro replied:
Thanks George. It worked nicely.

Javier

Reply to this topic