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

More
3 years 4 months ago #107471 by mrli999
mrli999 created the 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? 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?

Please Log in to join the conversation.

More
3 years 4 months ago #107478 by DenisChenu
DenisChenu replied the topic: Is it possible for me to use javascripte to read session in the start.pstpl
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.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: mrli999

Please Log in to join the conversation.

More
3 years 4 months ago #107481 by mrli999
mrli999 replied the topic: Is it possible for me to use javascripte to read session in the start.pstpl
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!

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now