Re: ASP sessionstate
From: Evertjan. (exjxw.hannivoort_at_interxnl.net)
Date: 02/09/05
- Next message: Evertjan.: "Re: urgent-how to pass values into the parent form"
- Previous message: Evertjan.: "Re: ASP sessionstate"
- In reply to: Roland Hall: "Re: ASP sessionstate"
- Next in thread: Roland Hall: "Re: ASP sessionstate"
- Reply: Roland Hall: "Re: ASP sessionstate"
- Messages sorted by: [ date ] [ thread ]
Date: 09 Feb 2005 09:02:40 GMT
Roland Hall wrote on 09 feb 2005 in
microsoft.public.inetserver.asp.general:
> Firefox never fails. Only IE has the issue.
so it is a clientside issue. ASP doesn't know or care what browser it
sends his rendered html output to.
> We found out the value
> is being set to 0 and we also found out that receipts, while not
> displaying on screen, are being written to disk. This is the same
> issue I had with cookies so it must be something I'm doing in the way
> I write the page. Without throwing the whole page up, I'll cover the
> main parts.
>
> ASP directive and turn on buffering
> 2 include files, 1 for nocache and 1 for my common routines
> Dim vars
> ' My session test
> if session("ticket") = 0 or IsEmpty(session("ticket")) then
if session("ticket") = 0 or session("ticket")="" then
will cover all possibilities.
session("ticket") = 0 can ony be returned if it was initialiszed
somewhere else serverside.
> Response.Clear
> Response.Redirect("/")
Response.Clear is unnecessary before a redirect.
Any cached html-to-be-sent will be deatroyed anyway.
If html is already sent [by a response.flush?]
Response.Clear cannot stop that and
the Response.Redirect is invalid,
as Response.Redirect sends a header instruction
to the browser to redirect
and cannot do that if the header is already sent.
> else
> cartid = session("ticket")
> end if
> get form values and assign them to variables
> HTML code is written into strings using ASP - Ex. str = "<html>"...
> ASP variables included where required.
> As I need to write VBScript code
Serverside? [also serverside Jscript is possible if you prefer]
> , I do that, then add another string
> of HTML code, etc.
> There are 7 strings
> After the third, I grab the shopping cart from an XML file and put the
> results into an array.
> I loop through the array adding the purchased items to the receipt,
> add more HTML code and write the string to the screen.
Not to the server screen, surely?
You send the string as rendered html to the browser with a
response.write?
> After the strings are assigned and written to the screen, I write the
> receipt, passing the cart ID and the strings to a sub.
Sorry, I cannot follow you here.
> At the end I have to subs,
Sorry, I cannot follow you here.
> delete the cart file and set the session
> number to 0.
What is a session number? Never heard of that.
[If you mean session-id, do not touch that.]
> I believe since I'm buffering the page, and the receipt is being
> written, the cart file delete and session initialization are happening
> and then my test at the top is being performed so I sometimes do not
> see the receipt.
Session initialisation is done by the server system, before the
sesrverside execution of the first page of a session begins. The server
first examines the page request from the browser, and if there is no
[valid] session-id cookie value, the ASP server starts a new session.
You cannot do anything [like cart file delete] before session
initialisation.
> Why Firefox doesn't have a problem with it or why it
> works sometimes, is confusing. I removed the nocache include and now
> it only fails after 3 successful ones for me.
>
> I've decided to take a different approach. After the receipt is
> written, I call another page to cleanup and then redirect to the home
> page. This effectively eliminates the issue and makes it stable.
> IE
> apparently executes code on the page in some unknown order thus making
> the last line of code excute before the some at the top.
IE, firefox or any other browser do not execute ASP code at all!!!
Do you perhaps mean clientside code?
Do you have clientside vbscript?
[That will only be executed by IE and not by firefox.]
-- Evertjan. The Netherlands. (Replace all crosses with dots in my emailaddress)
- Next message: Evertjan.: "Re: urgent-how to pass values into the parent form"
- Previous message: Evertjan.: "Re: ASP sessionstate"
- In reply to: Roland Hall: "Re: ASP sessionstate"
- Next in thread: Roland Hall: "Re: ASP sessionstate"
- Reply: Roland Hall: "Re: ASP sessionstate"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|