SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    I need to delete the cookie that a session sets. I know there is an option in php.ini to make a session not set a cookie, but I do not have access to the config files. Anyone know how to do this?

    Thanks

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Set in an .htaccess file, one option is to set a per session cookie that merely sets a cookie with the value of the session id and then have the session hadler be a MySQL database to keep track of session variables, check out http://www.hotscripts.com There is a MySQL session handling lcass that may be of interest to you.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    I was trying:
    Code:
            setcookie(session_name(),"",0); 
    	session_start();
            $id = session_id();
    So that $id is a new, unique value, rather than the value in the session cookie, but that did not seem to be working. I am doing this because with a script I am creating, I pass $id along through the URL. The id in the url can be changed (making the login screen appear again), but when you login once again, the id is the same as the id that was changed in the url. This problem does not happen when I change my browser settings to not accept cookies.
    Any ideas?

    <Edited by robp on 12-17-2000 at 09:09 PM>

  4. #4
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried using
    ini_alter(session.use_cookies,0) or die ("ERROR"); at the start of my script, but got the "ERROR" thus meaning the variable in php.ini could not be changed. Any ideas why this happened?

  5. #5
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although it seems like I am talking to myself, if anyone is curious as to why tje ini_alter() did not work, it was because I forgot the quotes

    ini_alter("session.use_cookies","0");
    works perfectly. If anyone does not want a cookie set when using sessions, use this unless you have access to edit php.ini directly.


Bookmarks

Posting Permissions

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