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?
[Solved] Issues with $_SESSION
[Solved] Issues with $_SESSION
Last edited by campey on Thu Jul 12, 2012 4:51 am, edited 1 time in total.
Re: Issues with $_SESSION
Have you tried using formbuilder with the captcha module?...
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Issues with $_SESSION
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.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?
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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Issues with $_SESSION
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
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
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.