[PHP] problems with sessions!!AAH
Hi, Im running a win2k with apache and PHP 4.3.4 and I have gone through the installation readme for PHP. I have copied the necessary files to the correct directories. I have also set register_globals= Off (default) I have set my session path (it exists). Now my problem is that I cant get my sessions to work at all. I have tried everything and no luck. Ok here is what I do: $_SESSION['login']=true; if (session_is_registered($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); I have not used the session_register function as the manual says the following: If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. I seriously dont know what else to try or do. If you think I've missed something then please help. Thanks in advance Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
if (session_is_registered($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); try if (isset($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problems with sessions!!AAH
[snip] Ok here is what I do: $_SESSION['login']=true; if (session_is_registered($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); I have not used the session_register function as the manual says the following: [/snip] Have you set session_start? http://www.php.net/session_start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problems with sessions!!AAH
ok I thought the problem was fixed but its not. The session variable gets registered correctly however when I go to the next page and too see if its still registered using the isset() function its not registered anymore. I do have session_start(); at the top of the new page. I cant think why its not working?!?! TIA Jay Blanchard [EMAIL PROTECTED] 8/16/2004 4:46:16 PM [snip] Ok here is what I do: $_SESSION['login']=true; if (session_is_registered($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); I have not used the session_register function as the manual says the following: [/snip] Have you set session_start? http://www.php.net/session_start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ok I thought the problem was fixed but its not. The session variable gets registered correctly however when I go to the next page and too see if its still registered using the isset() function its not registered anymore. I do have session_start(); at the top of the new page. I cant think why its not working?!?! Are you using cookies? What are your session configuration values? Regards, Torsten TIA Jay Blanchard [EMAIL PROTECTED] 8/16/2004 4:46:16 PM [snip] Ok here is what I do: $_SESSION['login']=true; if (session_is_registered($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); I have not used the session_register function as the manual says the following: [/snip] Have you set session_start? http://www.php.net/session_start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
On Mon, 16 Aug 2004 17:39:21 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: ok I thought the problem was fixed but its not. The session variable gets registered correctly however when I go to the next page and too see if its still registered using the isset() function its not registered anymore. I do have session_start(); at the top of the new page. I cant think why its not working?!?! make sure that the session cookie is being set. check the session_id() on both pages, make sure they are the same. If they arent, you are having a problem getting the sid passed from page to page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
Hi Matt, The session_id() is correct on both pages. Some info I forgot to add is this: on my first page: session_write_close(); header(Location: franchise_menu.php?.SID); exit(); however on my franchise_menu.php page, no SID is displayed in the browser address. could that be a reason? Or have i misconfigured something? TIA Matt M. [EMAIL PROTECTED] 8/16/2004 5:59:26 PM On Mon, 16 Aug 2004 17:39:21 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: ok I thought the problem was fixed but its not. The session variable gets registered correctly however when I go to the next page and too see if its still registered using the isset() function its not registered anymore. I do have session_start(); at the top of the new page. I cant think why its not working?!?! make sure that the session cookie is being set. check the session_id() on both pages, make sure they are the same. If they arent, you are having a problem getting the sid passed from page to page. Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
no I'm not using cookies. Session configuration values from php.ini: session.save_handler = files session.save_path = c:\temp\sessions session.use_cookies = 0 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 is there anything else that I am missing or is anything set incorrectly? thanks guys, really appreciate it. Torsten Roehr [EMAIL PROTECTED] 8/16/2004 6:00:01 PM Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ok I thought the problem was fixed but its not. The session variable gets registered correctly however when I go to the next page and too see if its still registered using the isset() function its not registered anymore. I do have session_start(); at the top of the new page. I cant think why its not working?!?! Are you using cookies? What are your session configuration values? Regards, Torsten TIA Jay Blanchard [EMAIL PROTECTED] 8/16/2004 4:46:16 PM [snip] Ok here is what I do: $_SESSION['login']=true; if (session_is_registered($_SESSION['login'])) echo(seesion is reg); else echo(seesion not reg); I have not used the session_register function as the manual says the following: [/snip] Have you set session_start? http://www.php.net/session_start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
session_write_close(); header(Location: franchise_menu.php?.SID); exit(); SID will be empty if session ID was set in an appropriate session cookie if you do a print_r($_SESSION) on franchise_menu.php do you see anything? If you have access to the webserver you could just go in and look at the session file that php creates. It is pretty easy to find and you should be able to see your variables if they are being correctly written to the file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions!!AAH
Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Matt, The session_id() is correct on both pages. Some info I forgot to add is this: on my first page: session_write_close(); header(Location: franchise_menu.php?.SID); exit(); however on my franchise_menu.php page, no SID is displayed in the browser address. could that be a reason? Or have i misconfigured something? Hi Angelo, your code looks right but you should see the session id in the address bar after the redirect. Does echo SID produce any output? By the way, I don't think you need to call session_write_close(). Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php