Jump to content


Photo

session id's


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 24 July 2006 - 03:25 PM

Ok I know everything I need to know about basic sections, I already found out about having to use session_start();
and it having to be the first line, I found out about
session_register()
being deprecated, and that you should instead use
$_SESSION['variablename'] = "whatever here";
permanently instead of session register.
I know how to check to see if a session is registered.  I have a few quick questions now, what about session id's do I need to do anything with them, if so what.  Should I go ahead and just do it with cookies, or do you think I should use a database, can I still use a database, and have the same affect, I just basically need a few pointed fingers.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 July 2006 - 03:28 PM

Ok I know everything I need to know about basic sections ... I have a few quick questions now, what about session id's do I need to do anything with them, if so what.  Should I go ahead and just do it with cookies, or do you think I should use a database, can I still use a database, and have the same affect, I just basically need a few pointed fingers.


The answers to the questions depend on what it is that you're trying to accomplish.  Care to rephrase your questions into some sort of context?
Legend has it that reading the manual never killed anyone.
My site

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 24 July 2006 - 03:38 PM

Alright
1. If I just go with straight original sessions.
I use session_start() at the top of every page, I set my sessions with the stuff I want.
At the top of each name below that I put if whatever and password protect the page, does session_start() set an id automatically.  basically is there anything at all I need to do to set an id, or to retrieve an id from a cookie, if I am just using standard cookies for the id's and files for hte session save locations.

2. Now if I decided to use databases, is it like an alternative to cookies, do they like save the session id's in the database, and the session information in the files, I was wanting sessions to save normally but maybe save session id's in a database, so people don't have to have cookies enabled, because unfortunately a large part of our population doesn't use cookies.

3. If I store all session information in the database, and session id then is there anything special I need to keep in mind, or anything extra I have to do to retrieve session information

4.  if I can and do store teh sessions in a file, and hte id's in a database, do I need to do anything more to retrieve the session id from teh database than I would need to do to retrieve it from a cookie

5.  Which is better/easier/more secure.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 24 July 2006 - 03:44 PM

1. If I just go with straight original sessions.
I use session_start() at the top of every page, I set my sessions with the stuff I want.
At the top of each name below that I put if whatever and password protect the page, does session_start() set an id automatically.  basically is there anything at all I need to do to set an id, or to retrieve an id from a cookie, if I am just using standard cookies for the id's and files for hte session save locations.

sessions_start generates a session id automatically, if one hasnt been set. It wil also automaitcally resume a session if the session id is still valid.

If you want to store your sessions within a database you have to create your own session handler, quite complex if you are starting with sessions. However the defualt behavior of a session is fine.

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 24 July 2006 - 04:06 PM

Alright then I will go with the standard way for now, after I do a few sites using that, and get a little more well rounded, then I will start working on dealing with things afterwards.  And trying to do what I can about starting setting up my own Session Handling, this project isn't paying enough, and I need the basics, before I can jump to intermediate and advanced sessions.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users