You are here: Re: session length « PHP Language « IT news, forums, messages
Re: session length

Posted by Ron Eggler on 12/20/07 19:08

Onideus Mad Hatter wrote:

> On Mon, 17 Dec 2007 21:01:40 GMT, Ron Eggler <NOREPLY@example.com>
> wrote:
>
>>Ron Eggler wrote:
>>
>>> Michael Fesser wrote:
>>>
>>>> .oO(Ron Eggler)
>>>>
>>>>>But how can I recognize if someone just closed the Window?
>>>>
>>>> You can't. The session just times-out.
>>>>
>>>>>Isd this any usable? How would you recommend me going on this?
>>>>>What I want: I wanna see which user looks for how long on my page
>>>>>without closing the window -?
>>>>
>>>> Impossible. All you can get is the time between the first and the last
>>>> request made to your site. What happens after the last request is out
>>>> of your control. You can't tell whether the visitor is still reading
>>>> your page for an hour or if he's away already.
>>>>
>>>>>how long the session is active. If the window is
>>>>>closed now, no out time is being recorded... :(
>>>>
>>>> That's simply how HTTP works. Remember: It's a stateless protocol.
>>>> Every single request is completely independent from each other:
>>>>
>>>> * user sends request
>>>> * server answers request
>>>> * user is gone
>>>>
>>>> That's it, no more no less. Session are just a way to partly overcome
>>>> this issue.
>>>>
>>> Michael,
>>>
>>> Thanks for your response and right - I can record how long a user is
>>> looking at my page by Javascript. Now I'm thinking if i can call a php
>>> script every e.g. second that would update the information in a mysql
>>> table... but do i actually need to display the "dummy php"page in a
>>> frame even tho there's no html output or can i just call it"hidden" in
>>> the backkground somehow?
>>>
>>> Thanks,
>>> Ron
>>I got an idea: I'll load my content into one frame (the content where i
>>wannas know the session time). And in the other frame (null frame) i load
>>a script that's writing data passed by GET into a db. The time is measured
>>by javascript in the content file and every minute i call my null frame
>>php, passing the time over in the url.
>>That should work fine.
>>*building it now* :)
>
> ...don't do that.
>
> Just call the script like an image file using javascript, that's what
> I do.  Like nyah:
>
> :           A = "<img src='blah.php?screen_width=";
> :           B = screen.width
> :           C = "&screen_height=";
> :           D = screen.height
> :           E = "&color_depth=";
> :           F = screen.colorDepth
> :           G = "&os=";
> :           H = OS
> :           I = "&browser=";
> :           J = browser
> :           K = "&version=";
> :           L = version
> :           M = "&cookies=";
> :           N = cookies
> :           O = "&java=";
> :           P = java
> :           Q = "&flash=";
> :           R = flash
> :           S = "&flashversion=";
> :           T = flashversion
> :           U = "&time=";
> :           V = time
> :           W = "&ref=";
> :           X = document.referrer
> :           Y = "&raw=";
> :           Z = raw
> :           AA = "'>";
> :    
> :           document.write(A + B + C + D + E + F + G + H + I + J + K + L +
> :           M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + AA);
>
> That way you don't need to bother using frames or multiple pages of
> any sort.
>
That would have been a good idea... you're right but i already got it
working.... :) But - damn, i shoulda thought about this earlier as well -
hmm anyways i may get the chance to change it a lil later... it would be
nicer to have two files only instead one 3 :)

Thanks for the hint for sure and damn me! :)

Ron

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация