Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well to answer you're first question "Is there a better way using php to do what I did above?"</p> <p>Essentially I fell that comes to a matter of opinion as there are soooo many options. It's what you feel comfortable with and what purpose you have for your application. </p> <p>Personally, (I say this not to pressure you but to offer an option) I use the javascript login, it's from facebook, it's a beautifully crafter script that's clean, fast etc etc that can be found <a href="http://developers.facebook.com/docs/guides/web/" rel="nofollow">here</a> (it's at this stage I apologize if my info is outdated as I've just noted this very second that facebook have updated that page lol!) the good part is that it saves the auth token as a variable (which you can change to a session if you wish) and that's done essentially as you just tack that onto the end of most urls like you have shown. </p> <p>(although looking through the new updated website the code looks a tad more 'complex' in it's layout so don't be afraid to ask ask for help and i'll give you the original code)</p> <p>Question 2: how do you get/ set session varibles... Well there are many things and ways etc etc... however I'll keep the basic/simple version and add notes that you should file away in your mind for more advanced options. Firstly, at the start of any page with a session varible in it you should start with</p> <p><code>session_start();</code> </p> <p>and then when you want to add a session varible it's a matter of simply </p> <p><code>$_SESSION['session_variable_name'] = $variable;</code> </p> <p>(yes I know you're suppose to do the whole foo and bar thing but they annoy me :D ). And that's it! If you want to "log-out" you can </p> <p><code>session_destroy();</code> </p> <p>and it'll stop carrying the session details. Now session notes:</p> <ul> <li><p>Unless stated otherwise, sessions are usually saved on your server as files! This could breach any privacy statements you have made!</p></li> <li><p>Sessions often do not survive across subdomains (www.website.com -> website.com) and it's not really advised to $_POST the data. Furthermore, some people experience problems going from http:// to https:// with session data.</p></li> <li><p>Sessions do not last forever, they essentially leave the session ID in a cookie on the client browser for later reference.</p></li> <li><p>When you have multiple servers for traffic weight distribution you can again lose the session as it is not passed across servers. You can save them in a location that all servers can access or have a server that caters for sessions like memcache.</p></li> </ul> <p>And I think that's the most you'll ever need to know about sessions :P</p> <p>I hope that helped!</p> <p>Jon</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload