By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Session+Javascript

P: 4
Hi All how can I access Session variables in Javascript
Jun 29 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Why would you want to access them using Javascript?

As with any server-side code, in your code, generate the Javascript including the session variables, e.g.
[PHP]<?php echo "<script type='text/javascript'>var sessVar = '".session->var."';</script>" ?>[/PHP]
Jun 29 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.