Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: Session advice

  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hey.

    My current php project.. I have a links.inc file which includes the websites links.

    Also in that file it checks to see if a session variable is set, if it is, it shows a link to logout.php. If it is not set, it shows a link to login.php

    Now, I have the session_start(); at the start of the file that includes links.inc

    The links are appended with the PHPSESSID

    I was just wondering if anyone had any better ideas on how to set this out, as I would prefer if my links were not appended with the id of the session.

    I suppose one way would be to link to admin.php which would check whether or not they are signed in, that way I would not need the session on the pages where authorisation is not required.

    But then if they go from admin.php (authorisation needed) to index.php (none required) and then go back to admin.php I will lose the session information.

    Hope this is clear..

    Thanks in advance

  2.  

  3. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    You can force PHP to use only cookies for session handling (thus removing the session ID get variable). Look at http://uk2.php.net/session and specifically at the session.use_only_cookies setting. If you can't access php.ini, check this out: http://aftnn.org/journal/508 .

    HTH
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  4. #3
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Thanks eKstreme, good link there.

  5. #4
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    One tip though, and you must have read it by now: If you use only cookies, anyone who disables cookies will not be able to use your site. That's the main reason for using get variables to track sessions.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:22 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com