all groups > inetserver asp db > june 2006 >
You're in the

inetserver asp db

group:

Sessions



Sessions James Jones
6/15/2006 11:00:01 AM
inetserver asp db: few quik questions.....


i have sessions sesrt on my page to check for user ogins. if the session is
true, then they are logged in. would it be better to use cookies? i havnt
learned how to use those yet, but i can learn. (if thats best way, then
anyone provide me a link to a good tutorial for one?)


also, is it best to use an INCLUDE FILE to store all the variables that are
used each page...........or is there a better way to store variables for
each user on each page?


thank you for any help anyone can provide.

Re: Sessions James Jones
6/15/2006 12:16:18 PM
im sry those were typos........


sesrt = set
ogins = logins


yes the variable is true in the session


im just wanting users to login, and need to know the best way to save their
login information. if sessions are used, then they are closed when the
browser is closed.....i really dont want that....................i would
like the user to be able to stay logged in while they are off the page, for
a certain amount of time




[quoted text, click to view]

Re: Sessions Bob Lehmann
6/15/2006 4:55:44 PM
[quoted text, click to view]
What is 'o' ?

Don't you just hate that ? :>)

Bob Lehmann


[quoted text, click to view]

Re: Sessions Evertjan.
6/15/2006 5:05:38 PM
James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

This is far to quick a question for me, please ask slowly, James.

Tell us what is a sesrt?
And what are ogins.

How can the session be true?
Do you mean a specific session variable having a value true?

The best way is always a matter of opinion and taste,
and what you are trying o accomplish,
[which you did not tell]
so no one can answer that for you.

--
Evertjan.
The Netherlands.
Re: Sessions Evertjan.
6/15/2006 6:29:26 PM
James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

[please do not toppost on usenet]

[quoted text, click to view]

That is not the same.

A session variable is a serverside variable that can be used all over the
session and while in session:

<%
session("mySessionVariable") = true
%>

[quoted text, click to view]

There is no "best" way, and there are many good ways.

[quoted text, click to view]

Impossible because that is not the definition of "logged in"

However, you can use a cookie in stead of a session variable.

try:

<%
response.cookies("myCookie") = true
response.cookies("myCookie").expires = Date + 365
%>

and

<%
if requesst.cookies("myCookie") then
response.write "Yes!"
end if
%>


--
Evertjan.
The Netherlands.
Re: Sessions James Jones
6/15/2006 8:51:29 PM
im just want to find the best way to log a user in, and have the user stay
logged in for more than 20mins of inactivity. and the best way to store
variables for the user........i like sessions, but im not sure if there is a
easier way.






[quoted text, click to view]

Re: Sessions Evertjan.
6/16/2006 12:00:00 AM
Bob Lehmann wrote on 16 jun 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

Eiher my fingers are geing shorer,
or he keyboard key "" is no reacing
as i should.

[quoted text, click to view]

Yes, I hae when i does ha, Bob!

--
Evertjan.
The Netherlands.
Re: Sessions Evertjan.
6/16/2006 12:00:00 AM
James Jones wrote on 16 jun 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

The session timeout can be changed by your code.

--
Evertjan.
The Netherlands.
Re: Sessions James Jones
6/16/2006 7:32:34 PM
o yea, i forgot that is possible...........

..how would i be able to detect if a user is activley browsing?






[quoted text, click to view]

Re: Sessions Evertjan.
6/17/2006 12:00:00 AM
James Jones wrote on 17 jun 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

[please do not toppost on usenet]

[quoted text, click to view]

Do you mean, if a page is requested?
Isn't that self evident?

You could put this in each page:

<br><%
if session("accessed")<>"" then
response.write "Last access in this session on: " & session("accessed")
end if
session("accessed") = now()
%><br>


--
Evertjan.
The Netherlands.
Re: Sessions Mike Brind
6/17/2006 2:12:46 AM

[quoted text, click to view]


'Setting the value of a cookie
Response.Cookies("MyCookie") = "value"

'Setting the values of cookie keys
Response.Cookies("MyCookie")("MyKey") = "value"
Response.Cookies("MyCookie")("MyOtherKey") = "anothervalue"

'Setting the expiration to 30 days from now
Response.Cookies("MyCookie").Expires = Date + 30

'Reading the value of a cookie
Response.Write Request.Cookies("MyCookie")

'Reading the value of a cookie key
Response.Write Request.Cookies("MyCookie")("MyKey")

'Deleting a cookie
Response.Cookies("MyCookie").Expires = Date-1


[quoted text, click to view]

What kind of variables? How long do they persist? Are they relevant
to other pages?

--
Mike Brind
Re: Sessions James Jones
6/17/2006 8:24:38 AM
the variables are information about the user that are used anytime the user
loads a page..............i was told the sessions take a lot of server
resources. so would i be best to use cookies?












[quoted text, click to view]

Re: Sessions James Jones
6/17/2006 8:49:51 AM
o ok.....

they will be strings.............





[quoted text, click to view]

Re: Sessions James Jones
6/17/2006 9:02:01 AM
ok thanks a lot everyone!





[quoted text, click to view]

Re: Sessions Bob Barrows [MVP]
6/17/2006 9:37:11 AM
[quoted text, click to view]
He did not ask about the data stored in the variables. He asked about the
types of variables you are using: are you storing strictly numbers? strings?
arrays? COM objects?

"a lot" is extremely vague. I use session variables all the time to store
small bits of information about the session: strings and numbers.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Sessions Bob Barrows [MVP]
6/17/2006 9:57:25 AM
In that case, you are probably better off worrying about some other part of
your application.

[quoted text, click to view]

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

AddThis Social Bookmark Button