CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Detect session, redirect to default.asp

Print topic Send  topic

Author Message
Rene S
Posted: 01/18/2006, 1:54 AM

Hi,

My multilanguage website getting along perfectly (a lot of thanks to Forummembers) One problem however.

In default.asp the user chooses a language, a session is started "Locale", and the language persists. Now, if the user bookmarks a page and opens it another day, then there is no session and therefore he gets the default language.

My question is: is there a way to redirect a user to "default.asp" if there is no session?

Can you give a code example in ASP?

Thanks,

Rene
TheunisP

Posts: 342
Posted: 01/18/2006, 2:17 AM

R, just for interest sake - doesn't redirecting the user from a bookmark kinda of defeat the object of the excercise? Maybe a better solution would be to change how you remember the user's language a more persistent cookie perhaps?

my 5c
View profile  Send private message
Rene S
Posted: 01/18/2006, 6:45 AM

Hi TheunisP,

You are right.
However, the problem with cookies is that they get "cleaned up" more and more (anti-spyware etc. at least on my computer). The website is not really huge, so to bookmark a specific page is not really neccesary. (At least I hope not). So the only solution I see here is to redirect to "choose language" page, and from there they can enter. Do you have the solution for me....

Thanks,

Rene
Mark1
Posted: 01/18/2006, 1:20 PM

If Session("locale") = "" Then

Redirect = "Default.asp"

peterr


Posts: 5971
Posted: 01/18/2006, 5:48 PM

Rene,
The above code should work. But I also recommend using cookies together with this so that people don't always get redirected to the main page if they already have the appropriate cookie. There is an option in CCS to use cookies for the language selection, so you don't need to do anything special.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Rene S
Posted: 01/30/2006, 9:13 AM

And again, it works! Thanks alot

Rene

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.