Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
ASPProtect Full 6.x Archives (Info Locked Info Locked)
 CJWSoft Support Info : ASPProtect Full 6.x Archives
Subject Info: checking user has signed in A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
francais
New User
New User


Joined: November/07/2004
Location: United States
Online Status: Offline
Info: 3
Added: November/07/2004 at 1:03pm | IP Logged Quote francais

There are several pages on my website that a user may go to that are not protected (e.g. home page).  If the user has indicated that they want to be saved on this computer (until they explicitly log off), and their 1st entry point is to an unprotected page, how do I determine whether they have logged in before, and extract the info from the cookie / session variables without forcing them to log in or making the entry page protected?

 

Back to Top View francais's Profile Search for other info by francais
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: November/07/2004 at 1:07pm | IP Logged Quote cwilliams

I am not sure totally understand your question.
I need you to explain it differently.

Any ".asp" page that is protected is going to automatically prompt them for a login box or log them in automatically depending on if they set that option.. In the end returning them to that same page.

So, it really all takes care of itself for the most part.. It doesn't even matter if the bookmark a protected page deep in your site. The system is smart enough to keep them at that page as well as handle their access.

Now of course if they are at an unprotected page of your site and navigate to a protected page they get a loin prompt or are allowed in if they already logged in...

Also.. when you say unprotected page ? do you mean ".htm" or ".asp"



Edited by cwilliams on November/07/2004 at 3:46pm


__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
francais
New User
New User


Joined: November/07/2004
Location: United States
Online Status: Offline
Info: 3
Added: November/07/2004 at 5:31pm | IP Logged Quote francais

Let me put it this way.

My home page (default.asp) is an unprotected page.

When a user that has signed in on another (protected pages) and has the remember me checkbox checked closes the browser cookies should be set for the next time they return.

When the user opens their browser and returns  to my home page (default.asp), I'd like to put a message saying:
Welcome back <%Session ("Username")%>

How is this done?

Back to Top View francais's Profile Search for other info by francais
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: November/07/2004 at 7:55pm | IP Logged Quote cwilliams

Look in the "check_user_inc.asp" file..

You'll see the name of the cookie there and also get an idea how to access it.

In most versions it looks like this.

Request.Cookies("PASWORDSYSTEMCOOKIE")("COOKIE_USERNAME")

You'll want the cookie for the username because the session variable will not exist unless they have actually gone to a protected page during that session at the site.

It would probably be best the check for both the session and the cookie. That will make sure people logged in that arent using the cookie option still see the message you want to display.

Sorta like this..

GetUsername = ""
If Request.Cookies("PASWORDSYSTEMCOOKIE")("COOKIE_USERNAME") <> "" Then
GetUsername = Request.Cookies("PASWORDSYSTEMCOOKIE")("COOKIE_USERNAME")
Else If Session("Username") <> "" Then
GetUsername = Session("Username")
End If

Response.Write GetUsername



Edited by cwilliams on November/07/2004 at 10:01pm


__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 

Sorry, you can NOT post info.
This info has been locked by a info administrator.

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area


PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.powerasp.com,www.aspclassifieds.com,www.aspphotogallery.com,www.codewanker.com