By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

Theoritical question about SESSION

P: 16
Hi guys,

Sorry for asking something that maybe already obvious to you all. But since i'm newbie, i just need further explanation. (I've read the PHP Sessions thread written by Atli)

In my head, i figured out that actually a session variable is only somekind of global array variable stored in server that works in entire of our site (every page that need the session variable can access it).

So is it the same thing if i develop a technique that passing variables from one page to another page ? But of course, session makes it very simple.

In short, my question is :

session variable = regular variable that passed to every page?

---
Another question is :

Can we set the session time-out specifically on each page (so the time-out for page A would be different from B) instead of setting it globally in php.ini ?


Thank you very much.
Oct 21 '08 #1
Share this Question
Share on Google+
4 Replies


Dormilich
Expert Mod 5K+
P: 8,639
question one: yes (it's a superglobal like $_GET & $_POST)

question two: all I can think of to set an expiry time in the session after that the session will destroy itself by a (custom) function.

note: I've not yet worked with sessions, but that's how I'd do it

regards
Oct 21 '08 #2

dlite922
Expert 100+
P: 1,584

session variable = regular variable that passed to every page?
Yes

Can we set the session time-out specifically on each page (so the time-out for page A would be different from B) instead of setting it globally in php.ini ?
Yes. On Page A, before session_start() use ini_set() to change the timeout value.

This overrides what is in the php.ini file.


Good luck,




Dan
Oct 21 '08 #3

P: 18
I am also playing with sessions for the first time, but unable to get it write to the DB table

I had found this, and now here to research also sessions....and am heading here:
(I've read the PHP Sessions thread written by Atli)
thank's to this thread.

Hope the below helps all.

Jim

http://hudzilla.org/phpwiki/index.ph...s_for_sessions

PS.. I don't mean to be "hijacking" as someone said, but face it...without advance search functions ( per specific forum etc) There's going to be a lot of pages to search thru/...or am I missing something?n ( for an advanced search on this site) ??
Oct 22 '08 #4

Markus
Expert 5K+
P: 6,050
PS.. I don't mean to be "hijacking" as someone said, but face it...without advance search functions ( per specific forum etc) There's going to be a lot of pages to search thru/...or am I missing something?n ( for an advanced search on this site) ??
You are, but it's not your fault; I don't think there's a single link on this site to the search functionality. But here it is.
Oct 22 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.