|
Could anyone explain this behavior. I have two asp pages, page1 sets a cookie with the sessionid. I have an empty form that just goes to page2. On page2 the cookie is checked against the sessionid. Pretty straight forward stuff.
My browser is set to not accept cookies yet when I view the files from my local IIS the values are equal. When viewed from a remote site they are not, just as I would expect. i.e. Except no cookies, get no cookies.
<br />
Page1.asp<br />
<%@ Language=JavaScript %><br />
<%<br />
Response.Cookies("test") = Session.SessionID;<br />
%><br />
<%=Session.SessionID%><br />
<FORM action="page2.asp" method="POST"><br />
<INPUT type="submit"><br />
</FORM><br />
<br />
Page2.asp<br />
<%@ Language=JavaScript %><br />
<%<br />
if( Request.Cookies("test") == Session.SessionID )<br />
Response.Write(Request.Cookies("test"));<br />
else<br />
Response.Write("No cookies");<br />
%><br />
|
|
|
|
|
Forgive me if I am being dense, but when you say it works on "my local IIS" do you mean a copy of IIS installed on your development workstation or on a local development server?
In other words, is the IIS that the asp code seems to work on installed on the same machine that you are browsing from?
If so, I can not answer your question for certain but I have an idea. I have noticed some similar odd behaviours when testing code on my home system with IIS installed locally, but the same code works flawlessly on my work systems with IIS installed on a remote dev server.
My theory is that there is some direct communication taking place between the systems, because they are sharing the same memory space. I do not claim to understand how or why this happens. I have had similar issues with both cookies and with session variables, (which of course use cookies to relate the variable to the browser).
Does anybody have any idea how.why this might haqppen? I would be interested in knowing too.
Jason Jystad
Cito Technologies
www.citotech.net
>------------------------------------------------<
"Luckily," he went on, "you have come to exactly the right place with your interesting problem, for there is no such word as 'impossible' in my dictionary. In fact," he added, brandishing the abused book, "everything between 'herring' and 'marmalade' seems to be missing."
-- Dirk Gently (Douglas Adams)
>------------------------------------------------<
|
|
|
|
|
The condition exists on both my local development network and when IIS is on the same machine.
|
|
|
|
|
Well, heck then, you've got me. I haven't seen that happen. As I said, the symptoms I have seen disappear when I move the code to a remote dev server and browse from my workstation.
Sorry, guess I am no help.
Jason
Jason Jystad
Cito Technologies
www.citotech.net
>----------------------------------------------------------------------------<
"I never really understood how there could be things that would drive you insane just because you knew them until I ran into Windows."
-- Peter da Silva
>----------------------------------------------------------------------------<
|
|
|
|
|
Thanks. I'm stymied also. Everything works as expected on the hosted server, but not on a local network or on the same machine. If anyone has a guess I would be interested to hear it.
|
|
|
|
|
Hello, I'm very novice and don't know if this is possible, can I know how many people has connected into my web page? (without inserting a counter and anything that can be seen).
And can I know who has connected in?
|
|
|
|
|
You can see how many hosts (not users) have connected to your website by looking at the log files generated by your ISP. If they don't give you log files (free ISPs usually don't) then there's not a lot you can do.
Dave.
|
|
|
|
|
You can keep a list of each active session in a database, then display that number.
Jon Sagara
"Oh Lisa, you and your lies. Bart's a vampire, beer kills brain cells. Let's go back to that building... thingy... where our beds... is."
|
|
|
|
|
For a more specific answer it depends on what your using. Ill assume its IIS and jscript.
For total number of users
try something like this in your asp file:
----------
<%
if (Application("Count") == null)
{
Application("Count") = 0;
}
Application("Count") = Application("Count") + 1;
%>
You are vistor number:
<%= Application("Count") %>
----------
For total number of visits for a specific session
try something like this in your asp file:
----------
<%
//on first visit
if (Session("Count") == null)
{
Session("Count") = 0;
}
Session("Count") = Session("Count") + 1;
%>
You visited:
<%=Session("Count")%>
----------
Hope that helped.
|
|
|
|
|
You can also count the active users browsing your site using asp. (well, sort of, the article explains the limitations of this process)
This isn't ultra-basic but it is fairly easy to understand and is a useful introduction to a couple of fundamental asp tecniques.
Take a look at: http://www.asp101.com/resources/active_users.asp
Hope that helps!
Jason Jystad
Cito Technologies
www.citotech.net
>------------------------------------------------<
"Luckily," he went on, "you have come to exactly the right place with your interesting problem, for there is no such word as 'impossible' in my dictionary. In fact," he added, brandishing the abused book, "everything between 'herring' and 'marmalade' seems to be missing."
-- Dirk Gently (Douglas Adams)
>------------------------------------------------<
|
|
|
|
|
Help! Thanks in advance!
Here is an abreviated sample of some code I am working on (I am building a HTML doc in memory and amongst other things, inserting an image within a table cell, within a row)
hr = m_pHTMLPage->createElement(bstrTag, &pElement);
hr = pElement->QueryInterface( IID_IHTMLImgElement , (LPVOID*)&pImgElement);
// src, location of image
strImage = _strImage;
bstrImage = ::SysAllocString( strImage );
....
hr = pImgElement->put_align(bstrAlignment);
hr = pImgElement->put_alt(bstrAltText);
hr = pImgElement->put_src(bstrImage);
The code is within a DLL, and works fine when called from my test harness
However when calling the code from our product, it seems to cause an exception.
I've traced it to the put_src() method (in the fact that if I comment out the line, I no longer get the exception).
The line works fine, I exit the method, return to our product code… and then the first dll/MSHTML function I call I make (i.e. add another cell or save the page out), causes control, to jump to the nearest catch statement....
The HRESULT return seems correct (0)
I think the main problem is that I probably don't understand the IHTMLImgElement well enough…(the documentation is not so detailed…plus I cannot seem to find any code samples (besides Walk All) showing the use of the IHTMLImgElement object)
Roy
|
|
|
|
|
I'm working on a large web project (as a COM/C++ developer... not a webbie). This project uses COM objects to retrieve large amounts of data. The application uses DHTML to create tables with various properties (treated like a grid control) to display the data retreived by the COM objects. In order to retain the retrieved data from the COM objects the data is stored in multi-dimensional arrays in a hidden frame of the web project. That saves the user from having to re-retrieve the data from the COM components (which takes a couple minutes). However, each time the user goes back to the page is there a way I can cache that table so it does not have to be re-generated. It's so large it takes a long time to generate.
Thanks,
Matt
|
|
|
|
|
There are various commercial cacheing products available, here's a link to one I know of (no affiliation with them) http://www.xcache.com/
Another option that springs to mind is implementing some type of your own cacheing scheme. If the data doesn't change that regularly you could have your component write out the html for the hidden frame on an as needed basis. You'd need some way to determine whether you should send the statically generated html or if you need to have the component dynamically generate it again. Make sense?
Also, the new asp.net stuff has much more sophisticated cacheing capabilities that may be worth investigating if you can move to the .net platform.
Good Luck!
Jon
|
|
|
|
|
Thanks alot Jon. I may choose to try that HTML option. I'll take a look at the URL.
Matt
|
|
|
|
|
Speaking to the implementing your own caching scheme idea, I thought I would mention aspTear. I ran across a couple of articles on 4guys that talked about it. It works nicely for some lightweight work I am doing, with pages that change only rarely.
Here is the URL for part one of the article:
http://www.4guysfromrolla.com/webtech/071800-1.shtml
Hope that helps!
Jason Jystad
Cito Technologies
www.citotech.net
>------------------------------------------------<
"Luckily," he went on, "you have come to exactly the right place with your interesting problem, for there is no such word as 'impossible' in my dictionary. In fact," he added, brandishing the abused book, "everything between 'herring' and 'marmalade' seems to be missing."
-- Dirk Gently (Douglas Adams)
>------------------------------------------------<
|
|
|
|
|
Depending on the size of your data and if you can make IE 5 or newer a requirement for your application, you might want to let the client cache the data as xml using the userData behavior.
|
|
|
|
|
Is it possible to open a popup window using ONLY VBScript? I _know_ it can be done with JavaScript, but can it be done with VBScript alone? NOTE: I don't mean a MsgBox, I mean a proper browser window.
|
|
|
|
|
|
Er... because that uses JavaScript, when I specifically said only VBScript?
|
|
|
|
|
I'm currently working for a client that requested all server and client side code for their intranet site be done with vbscript.
While that isn't really important to you, I can say that most examples you see of client side code are done in javascript but the syntax is usually almost identical in vbscript barring the language differences like variable declarations, curly braces and line terminators, if you play around a bit I'm sure you can get a pure vbscript window.open to work just fine.
In fact, I'll make it really easy for you, took the javascript code from the dhtml reference in the message above, took off the line ending ";" and removed the parentheses because you get an error about calling a subroutine with parentheses. It's usually about that easy to translate javascript to vbscript because the object model is the same for dhtml you just have to eliminate the language differences.
Sub button1_onclick
window.open "layout.htm",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no"
End Sub
Good Luck!
Jon
|
|
|
|
|
Wow, I owe you an apology. I originally thought you had misunderstood my intentions... especially when that article had the example in JS {:v)
And knock me down with a feather, it works... I'm impressed. I'm just baffled as to why it is so hard to find information on it when I look {:v(
So thankyou.
|
|
|
|
|
Actually, I owe Andy an apology, since he was the original replyee and not yourself {:v)
Oh, it's been a funny day.
|
|
|
|
|
I agree with you, it's very hard to find any decent info in regards to using vbscript on the client side. It most definetly relates to cross-browser issues. When dealing with intranet's there is a legitimate argument to be made for using vbscript on both the client and server and not mixing languages when you're sure that everyone is using IE.
Hopefully you can see that the translation is pretty easy. I haven't found any javascript yet that couldn't be reworked into vbscript with a little bit of effort.
Good luck,
Jon
|
|
|
|
|
Thankyou, that's a very interesting discovery. I have to admit I don't intend to use VBScript client side because of the Netscape issue, but in this instance I wanted to use it to demonstrate a variety of Web programming 'languages', including both scripts, ActiveX, Java, DHTML (JS), etc.
|
|
|
|
|
Have fun!
    Sub Yar
        window.open "crap.htm"
    End Sub
Andy Gaskell, MCSD
|
|
|
|