?
Solved

global.asa equivalent in PHP

Posted on 2008-10-23
1
Medium Priority
?
458 Views
Last Modified: 2012-06-27
Hello,

I'm trying to keep track of a session variable in PHP.
It will be set to 0 when the user comes to the website but once they go to a certain page, I want it to be once throughout their session.
It should only be initialized to 0 when they close the browser.

Is there like a global.asa equivalent in php?
Thanks.
0
Comment
Question by:Isaac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
NoiS earned 2000 total points
ID: 22789553
hmmm...
Maybe I didn't undertand it right but...
Sessions in PHP are recoverable by de id (you can acess the value by session_id() function).
If you do a session_start() PHP automatically read the session_id() from $_COOKIE or $_REQUEST (in this order).
SESSION is used to identify uniquely a user. So you can simulate persistance of vars and objects.
Its praticaly impossible to control when user go out,  so, the session have a time to expire (or not).
Some people use some tricks to test if the user is displaying the contents with AJAX or put a js on body tag function onunload(); But is untrusted.
Think about it!
About global.asa. Global.asa is for WEB SERVER, not for the script language. There's none relationship.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question