- Posts: 146
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to read cookie in the survey?
- mrli999
- Topic Author
- Offline
- Premium Member
Less
More
10 years 2 months ago - 10 years 2 months ago #105367
by mrli999
How to read cookie in the survey? was created by mrli999
One web site:
www.example.com
has its own register and login system. Just like limesurvey.
When some body use his username and password login, such as I use mrli999 login limesurvey, the cookie was wrote. fox example cookie abc=("login","yes").
Then how can I read the cookie to check whether in cookier abc, login=yes or not? Can I use php code or js code to read the cookie in the template?
Or can I read cookie and use it in the equation question?
Many many thanks.
When some body use his username and password login, such as I use mrli999 login limesurvey, the cookie was wrote. fox example cookie abc=("login","yes").
Then how can I read the cookie to check whether in cookier abc, login=yes or not? Can I use php code or js code to read the cookie in the template?
Or can I read cookie and use it in the equation question?
Many many thanks.
Last edit: 10 years 2 months ago by mrli999.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13676
- Thank you received: 2496
10 years 2 months ago #105378
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic How to read cookie in the survey?
Hi,
You can read cookie in Javascript (if it's the same domain), but remind : cookie is really something without security.
What is the prupose ?
Denis
You can read cookie in Javascript (if it's the same domain), but remind : cookie is really something without security.
What is the prupose ?
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: mrli999
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
10 years 2 months ago #105393
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic How to read cookie in the survey?
I don't think using cookies is a good approach.
Maybe using webserver authentication would do the trick? Limesurvey offers hooks for this.
Maybe using webserver authentication would do the trick? Limesurvey offers hooks for this.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: mrli999
The topic has been locked.
- mrli999
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 146
- Thank you received: 2
10 years 2 months ago #105410
by mrli999
Thank you very much. Would you please let me know how to do it in details? Thanks again.
Replied by mrli999 on topic How to read cookie in the survey?
Mazi wrote: I don't think using cookies is a good approach.
Maybe using webserver authentication would do the trick? Limesurvey offers hooks for this.
Thank you very much. Would you please let me know how to do it in details? Thanks again.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
10 years 2 months ago #105418
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic How to read cookie in the survey?
I can't tell you in details because I don't use the feature but have a look at...
- manual.limesurvey.org/Authentication_plugins
- manual.limesurvey.org/Authentication_plugin_development
- manual.limesurvey.org/Optional_settings#...ion_to_the_Webserver
- www.limesurvey.com/de/forum/design-issue...erver-authentication
- manual.limesurvey.org/Authentication_plugins
- manual.limesurvey.org/Authentication_plugin_development
- manual.limesurvey.org/Optional_settings#...ion_to_the_Webserver
- www.limesurvey.com/de/forum/design-issue...erver-authentication
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- mrli999
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 146
- Thank you received: 2
10 years 2 months ago - 10 years 2 months ago #105437
by mrli999
Denis,
Thank you very much!
Then is it possible for me to use javascripte to read session in the start.pstpl? if yes, how? thanks again.
In more details:
If there is a session variable exampleid. In some case it's value is 99999999, other 99999998.
In the startpage.pstpl, I would like to check the value is 99999999 or 99999998. If it is 999999, alert and jump to a customer page (such as www.example.com/example/login.php ). If it is 99999998, go ahead and pass 9999998 to a question in the survey.
Is it possbile? And how?
Replied by mrli999 on topic How to read cookie in the survey?
DenisChenu wrote: Hi,
You can read cookie in Javascript (if it's the same domain), but remind : cookie is really something without security.
What is the prupose ?
Denis
Denis,
Thank you very much!
Then is it possible for me to use javascripte to read session in the start.pstpl? if yes, how? thanks again.
In more details:
If there is a session variable exampleid. In some case it's value is 99999999, other 99999998.
In the startpage.pstpl, I would like to check the value is 99999999 or 99999998. If it is 999999, alert and jump to a customer page (such as www.example.com/example/login.php ). If it is 99999998, go ahead and pass 9999998 to a question in the survey.
Is it possbile? And how?
Last edit: 10 years 2 months ago by mrli999.
The topic has been locked.