So I'm trying to do some basic session management here, between jQuery and PHP.
I'm attempting to set session variables in jQuery, and then access them on the next page using PHP.
PAGE 1:
- [code]
- $.session.set('username', 'UsErNaMe');
- [/code]
PAGE 2 (PHP): Outputs "NO USERNAME SET"
-
- <?php
- session_start();
- if(isset($_SESSION['username'])){
- echo "USER NAME IS " . $_SESSION['username'];
- }else{
- echo("NO USERNAME SET!!!!");
- }
- ?>
PAGE 2 (JAVASCRIPT): Outputs "UsErNaMe"
- alert("SESSION DATA: " + $.session.get('username'));
So basically, my problem here is that this jquery plugin is setting the session data for javascript, but it's not accessible via PHP. Is there a way to solve this?