"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
You need to call your session_start() to actually start the session on each page.
Up vote 1 down vote favorite share g+ share fb share tw.
After validating user input and storing login credentials I start a session by calling session::start and then reload the index. Php file by calling general::reload. The I use session::is_start() to determine which page to load from the index file.
I don't think this is working correctly as I always get the same page loaded - b1e.htm. My concern is that my static class session does not maintain its value between the AJAX/PHP call and the reload index. Php call.
Similar posting - here index. Php include 'b2. Php'; if(session::is_start()) { include 'b2e.
Htm'; // user is logged in } else { include 'b1e. Htm'; // user is not logged it } Snippet - session:start() and session::is_start(); class session { protected static $ses_id =""; public static function start() { self::$ses_id = session_start(); } public static function is_start() { return self::$ses_id; } public static function finish() { self::$ses_id = 0; $_SESSION=array(); if (session_id()! = "" || isset($_COOKIEsession_name())) { setcookie(session_name(), '', time()-2592000, '/'); } session_destroy(); } } Snippet - general::reload() class general { public static function reload() { $uri = 'http://'; $uri .
= $_SERVER'HTTP_HOST'; header('Location: '. $uri. '/host_name'); } php session link|improve this question edited Dec 26 '11 at 19:02 asked Jul 14 '11 at 18:42The All Foo2,140216 95% accept rate.
Unless you have not called session::start(), session::is_start() will always return an empty string. Is that what you want? – hakre Jul 14 '11 at 18:54 And what is your problem then?
As long as you don't start the session it won't be started. Please elaborate. – hakre Jul 14 '11 at 19:16 PHP is stateless.
If one run is over, the next run knows nothing about the previous run. You can use sessions to overcome this however, then you need to start the session at the beginning of each run. I guess you want to set a flag in the session on run1 you can check for on run2 then.
But that's not checking if a session exists. You understand the difference? – hakre Jul 14 '11 at 20:01 Because it's stateless, we use a session.
The session keeps data between requests, is a tool/method to add a sort of state in the stateless requests. See Introduction to Sessions (PHP Manual) - and sure you can encapsulate the functionality into a class of it's own. I think you just need to add some code to your class to get it working.
– hakre Jul 14 '11 at 20:26 Thanks good info. – The All Foo Jul 14 '117 at 19:00.
You need to call your session_start(); to actually start the session on each page.
You can still use a class, but your class needs to put things into the _SESSION variable or some other persistent store. – notJim Jul 14 '11 at 21:12.
You can encapsulate and consolidate session functionality, but you can not fully monitor sessions with a class as php user code is stateless (even when using static keyword)...i.e. It will depend upon SESSION to retain state.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.