|
Hmmm, you're right. I read somewhere that one of the main difference between ASP and PHP is how they handle sessions. I thought it said that PHP doesn't do it (atleast without using cookies, but from my ASP-centric viewpoint (cause I learned ASP first), thats not really 'session-handling' as I learned it), but apparently I'm wrong on that one.
I read over the PHP manual on sessions, and yeah, I did find a difference. "A visitor accessing your web site is assigned an unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL. " If I'm understanding it correctly, PHP leaves storing the session information up to the user. ASP, on the other hand, when a page is requested, it somehow determines if the user is unique, and based on that information, assigns that user's "unique information" a session ID - but all this is stored on the server. The PHP manual was kinda vague about whether the variables are stored on the server or the client, but all session information in ASP is stored on the server. The advantages of having it all on the server is that you have total control of the information. In PHP, a user can deny a cookie, and if their browser is closed, they loose the url-encoded information. In ASP, since everything is on the server, every request automatically has a session ID, and keeping this session ID reliable is now part of the server's job - not the client's. Now someone can view a page, reboot their computer, go back to the page, and (assuming it's within the session timeout limit) they're still using the same session. This gives you a bit more control. Long-term data is still stored in cookies. But again, unless you're going to use session-specific data in your website and you need this data to be accurate, you're probably not going to see a major difference in what you can do with ASP as opposed to PHP.
|