Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Simple PHP session question

  • 01-09-2014 12:18PM
    #1
    Registered Users, Registered Users 2 Posts: 4,946 ✭✭✭


    Hi!

    Im just wondering if I could get some input to using session on a website. There is a booking form on the site which has a 5 page journey and I dont want to keep passing variables with $_GET / $_POST as it is getting messy.

    Would it be a bad idea to just use session for some of this data? The data itself is in no way sensitive. I would usually just fire ahead and use session, but I feel like I'm missing something on this..

    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 159 ✭✭magooly


    PHP & sessions is what you are looking for.

    notes that come to mind:

    if you are authenticating users ie a login, you need to ensure your webserver login is over SSL
    All pages need to be served from the same host to preserve the session cookie.
    You need session::start at the start of every page in the conversartion.
    If you are storing any user submitted data in the session and eventually persisiting it into a DB you must pass it through the usual XSS(Cross Site Scripting) & SQL injection filters.


  • Registered Users, Registered Users 2 Posts: 4,946 ✭✭✭red_ice


    thats great, thanks!

    I should point out that the reason that I'm asking this is that Im more concerned about server performance than how to do a session!


Advertisement