Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Is it possible for me to use javascripte to read session in the start.pstpl

Is it possible for me to use javascripte to read session in the start.pstpl 2 years 7 months ago #107471

  • mrli999
  • mrli999's Avatar
  • Offline
  • Expert Lime
  • Posts: 139
  • Thank you received: 2
  • Karma: 0
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?
The administrator has disabled public write access.

Is it possible for me to use javascripte to read session in the start.pstpl 2 years 7 months ago #107478

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9555
  • Thank you received: 1373
  • Karma: 389
This need to be done in ajax, not in js only.

Or you can just use cookies :
- www.quirksmode.org/js/cookies.html
- developer.mozilla.org/en-US/docs/Web/API/document.cookie
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time (Need support ?).
A bug not reported is a bug not corrected. | 2.61lts version improved | Need plugins for LimeSurvey ?
The administrator has disabled public write access.
The following user(s) said Thank You: mrli999

Is it possible for me to use javascripte to read session in the start.pstpl 2 years 7 months ago #107481

  • mrli999
  • mrli999's Avatar
  • Offline
  • Expert Lime
  • Posts: 139
  • Thank you received: 2
  • Karma: 0
Thank you very much, Densi!

Is ajax very diffculty? If possbile, would you please let me know how to read the session using ajax? thanks again!
The administrator has disabled public write access.
Time to create page: 0.364 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form