Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    passing session data has stopped working :(

    Hi,

    been a while since I was here but I am back now.

    I have a login script which works fine. Once the login data is checked an iframe is loaded with an index.pl file.

    That 'index' script checks for the session data to be able to build the page but it is not getting the session data. It has been doing fine for about a year but yesterday it was reported not to be working.

    What is wrong with these two lines of code?

    In the login script we have this
    Code:
    my $cgi = new CGI;
    my $session = new CGI::Session($cgi) or die CGI::Session->errstr;
    and in the index file we have this

    Code:
    my $cgi=new CGI;
    my $session = CGI::Session->load($cgi) or die CGI::Session->errstr;
    why would the index file (the second set of code), not be getting the session data?

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    I should add that the CLAIMED_ID on the index file is the same as the session id of the login script. But session_id and all session variables, created in the login script are missing.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,944
    Thanks
    2
    Thanked 170 Times in 165 Posts
    If it suddenly stopped working, then there must have been some type of change made to either the scripts, or the system.

    The first thing I can think of is that the session vars created in the login script did not get saved prior to loading index.pl. Call the flush() method prior to loading index.pl to force the driver to save the session data, which is in memory, to the session file. And you might want to monitor the directory where the session file is being stored to verify that it actually being written.

    Do you have any error handling on the assigning/saving of the session vars?

    As a last resort, you could pass the session id as part of the query string.

  • #4
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Thanks Fishmonger,

    I was in a bit of a panic that day when I posted. As it turns out, no chnages were made to the scripts. But the cron job set up by my server company wasn't done correctly and so, about 450 000 session files were in the tmp folder causing the trouble. That has now been rectified (subject to testing), such that all session files will be deleted from the server after 48 hrs.


    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •