Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session Cookies not working after update to 3.2.2
#1
Hello,
first, thanks for your work and for the latest release.
All works fine, except for my Session Cookie JQuery Ajax Script.

I call the following script using a JQuery Ajax Post:
PHP Code:
<?php
    $result 
1;
    
session_start();
    if (
$_POST['command'] == 'togglesize' ){
        if (@(
$_SESSION['textsize'] == "normal") ){
            
$_SESSION['textsize'] = "big";
        } else {
            
$_SESSION['textsize'] = "normal";
        }
        
$result 0;
    }
  
/* some more... */
    
echo $result;
?>
The request works, but the SESSION cookie is not created and I have no access to the cookie later in my template.php. Did I overwrite some setting while performing the upgrade, oder is there something changed in session handling?

Greetings and thanks for hints!
Reply
#2
Not that I know of. We do not even use sessions.

Turn debug on and look for errors.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
Got it.

I had to put a manual session_start(); call in the top of my template, which wasn't there yet. In earlier versions this was not necessary.
No problem, if you once know it Smile

Greetings
Reply
#4
only thing i can think of is that something is now being output and breaking cookie sessions, could be whitespace somewhere, ill look if any files have whitespace after php closing tags.

Or you have a php error or something sending data before your old session start call.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
Thanks again for your fast reply!
(2013-08-13, 04:24:13)shawn_a Wrote: Or you have a php error or something sending data before your old session start call.

I made several tests using debug mode, but didn't find any php errors. Sessions work fine with an explicit "session_start();" command in the top of my templates. Without this, they won't work.
But I had no "old" session_start() call. Till yesterday there was no need to use one. Perhaps its cleaner coded now, or you had a session_start() call somewhere?
Reply
#6
The code you pasted has it what do you mean?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
(2013-08-13, 22:26:45)shawn_a Wrote: The code you pasted has it what do you mean?
The code I posted is the script, which is called by the JQuery-Ajax call from my website. This one has a session_start() thats true.

But my template itself, in which I use the session-cookie for e.g. to get my actual text-size settings (in this example) had no session_start command until I did the upgrade yesterday and it worked anyway.

Sorry, for my english and probably difficult way of describing things...
Reply




Users browsing this thread: 1 Guest(s)