Newbie question communicating between 2 progs
Ben Thursfield
twister at raplounge.de
Tue Jun 11 15:16:46 EDT 2002
Don Garrett schrieb:
> The two programs are only running while the frame they handle is being
> generated.
The one programm is running as long as i want it to, because i am using a while
loop, so that is no problem. So only the one that prints needs to be refreshed. I
want it to behave in a chat window manner, where it frequently prints out the last
25 lines.
> I'm assuming you aren't using some form of server push, which has it's own
> problems.
I actually don't know what a server push is, so I don't think I am using one ;-).
> However, the best answer to your question is to use cookies. The contents
> should be visible to all pages on the local site (you can control this) so
> they will allow you scripts to communicate with themselves and each other. You
> can store a fair amount in one (I'm not sure what the size limit is), and it
> can be binary.
I thougth that there must be a way of declaring data structers or whatever as extern
in a C manner. This does not seem to be the case, i suppose....
> A few warnings.
>
> Some people disable cookies. This can totally break your site.
>
> All cookies are always uploaded as part of every page request everywhere
> they are visible. This means that you shouldn't make them too large or you
> will slow your site. If they are big, try to restrict cookie visibility to
> just the pages that really need them. You can specify where the cookies are
> visible when you create them. You can even store the state info in a database
> and use the cookie as a key to retreive it.
>
> When it comes to security, you cannot trust the contents of the cookie. The
> contents need to be validated the same way the values from a form would be. A
> tricky black hat can force the cookie contents to be anything they want.
>
I was thinking about sth. like that actually. Only that I wanted to write the output
into an html file and then let the frame refresh that one. I then thought that there
must be a way to access the data some other way, as i didn't want to make a
directore one can write into, because of security reasons... The cookies way seems
better then. I don't know, but how do normal internet chat programms handle this? Do
they use cookies, too?
> Two last bits of advice from an old web developer (well as old as a web
> developer can be).
>
> Try to avoid frames. They cause a lot of problems for both you and for your
> users. For example, they often break cross-browser, they can break bookmarks,
> and they can break printing.
>
I know, on the other hand I didn't know how to do the program in another way :-( .
> Try to avoid refreshes, especially frequent ones. Someone with a poor link
> will spend more time looking at an empty page that hasn't loaded than they
> will looking at your content.
>
Good point, too.
Thanks for all your help!
> --
> Don Garrett http://www.bgb.cc/garrett/
> BGB Consulting garrett at bgb.cc
More information about the Python-list
mailing list