GetSimple Support Forum

Full Version: Session Cookies not working after update to 3.2.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
Not that I know of. We do not even use sessions.

Turn debug on and look for errors.
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
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.
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?
The code you pasted has it what do you mean?
(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...