Page 1 of 1
[Solved] Issues with $_SESSION
Posted: Tue Jul 10, 2012 12:42 pm
by campey
I have attempted to find an answer on the forums however I can't find one that directly answers my question.
I have a basic little captcha (this is an external PHP file) which I have on a contact page of my site. When I mocked it up pre-CMS Made Simple it worked fine. Now I can't get it working, the reason is the $_SESSION variable is always blank.
My question is why does CMS Made Simple "appear" to blank out session variables and can someone provide me with a solution on how to pass session information between external PHP and CMS Made Simple?
Re: Issues with $_SESSION
Posted: Tue Jul 10, 2012 3:31 pm
by Dr.CSS
Have you tried using formbuilder with the captcha module?...
Re: Issues with $_SESSION
Posted: Tue Jul 10, 2012 3:59 pm
by calguy1000
My question is why does CMS Made Simple "appear" to blank out session variables and can someone provide me with a solution on how to pass session information between external PHP and CMS Made Simple?
Sessions in php are configured with the session_name() and session_start() (and a few other functions, and settings. CMSMS sets the session name to something unique for the site and server. Though your session data from your other PHP files probably still exist CMSMS cannot see them because they are under a different session name.
You would need to modify your other php file(s) to use the same session name as CMSMS in order to share session data between scripts.
Telling you how to modify your other scripts, or how to modify CMSMS to share session data is beyond the scope of our product
support. All I can tell you is to read up on sessions in the php manual.
Additionally, CMSMS has a couple of good captcha modules that work properly, it is recommended that you use those if possible, rather than trying to re-invent the wheel.
Re: Issues with $_SESSION
Posted: Thu Jul 12, 2012 4:50 am
by campey
Ah! Thanks for the feedback (I love the CGContentUtils by the way!)
I think i'll just do as you said an use an existing captcha.
I was just curious on why!
Will resolve this issue
Re: [Solved] Issues with $_SESSION
Posted: Fri Aug 24, 2012 1:34 pm
by Thijs
Perhaps not relevant anymore but i had the same issue and i noticed that the session cookie was set with the 'Secure' flag which prevents it from being sent over unencrypted HTTP sessions. Since i used my site (and most people do) only over HTTP i could never use the $_SESSION. Changing the parameter session.cookie_secure to 0 in php.ini fixed the issue and i can use $_SESSION in UDT again.