w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to logout a user in php?
In your script to log someone out, simply have: session_start(); unset($_SESSION); session_destroy(); You should also call session_start() at some point in your login.php you have shown above.

Categories : PHP

PHP logout fails to log user out
Without seeing any of your actual logout code....Im just gonna go ahead and take a wild guess here.... My guess is you just didn't include session_start(); at the top of your logout script.... 95% of the time, that is the reason for logouts failing. Is that people just call session_destroy() but they forget that they still have to start the session on that page, so that the destroy() function knows there is a session to destroy... Let me know if that was your problem :)

Categories : PHP

Refreshing logout the user from the page
Use if(!isset($_GET['logout'])) { if(!isset($_SERVER['HTTP_REFERER'])) { header("location: auth.php"); exit; } else { $page = $_SERVER['PHP_SELF']; $sec = 10; header("Refresh: $sec; url=$page"); } } else { print "/*Error in refreshing*/"; } Hope this will help!

Categories : PHP

Add log to user login/logout Symfony2
Login event can be catched by security.interactive_login event. Read here. For logout needs to specify your own success_handler in logout firewall. Read here. The same can be done for a login. firewalls: main: form_login: failure_handler: mybundle.security.handler.failure success_handler:mybundle.security.handler.success logout: success_handler: mybundle.security.handler.logout

Categories : PHP

Force User Logout in jquery ajax
We tried something similar, but you cannot detect when user closes browser so easily. Easiest way was to use session as user access. This means that on each call, your client side should send some token and server side should check it. This token is saved on client side within cookie/storage (session storage, but it works only on tab as session) and it will expire as soon as user closes window/tab. Of course, your server side should support sessions. For tokens sending I suggest using authorization header, since it can be used from most development platforms, if you plan to expand from js to e.g. android platform sometime in the future.

Categories : Javascript

After Logout user can still access protected page
When the user issues "back" to its browser, the browser can decide to load the page from it's cache. the user won't be able to do what a logged in user can do because the session has been destroyed and is invalid. A possible workaround would be to include an AJAX-request on those sensible pages that checks if the user is still logged in. If yes, display the sensitive elements (or get them via ajax) and if not (the user is logged out) display a warning or forward him to a login-page (via js).

Categories : PHP

WSO2: How to logout a user that has obtained a 'rememberMeCookie'
As I understand there is no direct way to logout a user with a remember me cookie. I went through the code. Once you login with remember me option, a UUID is generated. Refer org.wso2.carbon.core.services.authentication.AuthenticationAdmin.loginWithRememberMeOption(String, String, String) method in AuthenticationAdmin The cookie is then saved in database. When you login with remember me cookie, the cookie is checked from the user store. Refer org.wso2.carbon.user.api.UserStoreManager.isValidRememberMeToken(String, String). You can check the JDBC implementation. So, in order to logout, you might have to clear the cookie from the user store. Please report a JIRA issue, if you think it might be useful to add a method to clear the cookie.

Categories : Authentication

How to insert time of user's logout in database?
You forgot the single quotes in your queries and you're not getting the value of $password $sql = "SELECT * FROM users WHERE username = '".$username."' AND password = '".$password."'"; $sql_2 = "INSERT INTO entry(username_id, entry_time) VALUES ('".$username."', NOW())"; updated for clarity <?php session_start(); // check that the session exists first if(isset($_SESSION['username'])) { // you should put your db connection in a config.php file and use mysqli or PDO - what you're using is depreciated mysql_connect("localhost", "root", "") or die("cannot connect"); mysql_select_db("zavrsni_rad") or die("cannot select DB"); // don't think I'd store password in a session... // also, is username UNIQUE in your database? // also, also, ALWAYS escape (sanitize)

Categories : PHP

php logout fails to log user out of the page they logged out from
i am assuming you have a bit of code in your script to check username session is set. session_start(); $_SESSION['userName'] =''; session_unset(); session_destroy(); header("Location: index.php");

Categories : PHP

How to clear the facebook user data after logout in android app
followed this link to fix this issue `private void onSessionStateChange(Session session, SessionState state, Exception exception) { if (state.isOpened()) { userInfoTextView.setVisibility(View.VISIBLE); } else if (state.isClosed()) { userInfoTextView.setVisibility(View.INVISIBLE); } }` ,here

Categories : Android

making function if database is not connect then logout user
I think it would be better if your connect function returns the $connection object if the connection and select database operation are successful and returns false if any of those fail. Then in your calling page/function check if the result is $connection, if it is then proceed, otherwise do the redirection. Something like following: public function connect() { $connection = mysql_connect($this->db_host, $this->db_user, $this->db_pass); if (!($connection && mysql_select_db($this->db_name, $connection)) { // Log the error mysql_error() return false; } return $connection; } And in your calling page/function: $connection = $db->connect(); if (!$connection) { header("LOCATION: logout.php"); exit(); } // Use your $connection v

Categories : PHP

Thinktecture Implicit Flow: Signout/Logout a user
To logout you have to create custom controller with logout method. public void Logout() { // You should be able to revoke thinktecture token like this. (haven't tested this out) var sam = FederatedAuthentication.SessionAuthenticationModule; sam.SignOut(); // Or you should be able to logoff like this when using a membership provider. (this way works for me) //_yourMembership.Logout(); Thread.CurrentPrincipal = null; HttpContext.Current.User = null; } Here is a sample of token revocation: https://github.com/brockallen/BrockAllen.MembershipReboot/blob/master/src/BrockAllen.MembershipReboot/Authentication/SamAuthenticationService.cs

Categories : Misc

SimpleMembership - User session logs - login logout history
No, there isn't an automagic feature, but you can simply override ValidateUser method of the provider and there save all needed info. Here you can find some samples

Categories : C#

How to restrict the user to go back previous logged-in pages after press logout
Once User get logged in, that time you need to store user id or mail id in session variable. And You have to put condition on all pages, that if session variable of user id or mail id is set then user can access that page else you have to redirect on Login page.

Categories : PHP

Disabled cookies will logout ion_auth user after redirect in Facebook Canvas
Set a cookie on the form page where you have the login form. That way you can check if the cookie was set correctly before logging them in. User opens or clicks and gets to login page. Set a cookie, show the form view. User enters login information on the form, and clicks. Before anything else -- Check to see if the cookie was set -- if it was not set then give them an error page with cookies required message. (ok i don't even know why i was looking at such an old question )

Categories : Facebook

Ajax request in prod environment causes Access is Denied (user in not fully authenticated)
I found the problem. The issue was that I was using absolute urls with 'www' i.e. www.mydomain.com, but the cookie host was without 'www'. Using relative urls now is all fine. Thanks all :) I found here my solutions, at the end: Symfony, jQuery.ajax() call, session variables lost

Categories : PHP

How can i disable the back browser button after user press logout and destroy session?
You should do a redirect from your logout script. For example: header("Location: index.php"); You if user hits back next time, it'll go to the logout.php page again, where you can do the check again and redirect again :) It's an infinite loop if the user tries again.

Categories : PHP

How to design page header style show logout when user mouseover on username
DEMO: http://jsfiddle.net/Rvvaa/ Added CSS #login:hover { background-color: yellow; /* illustrative colour */ height: 300px; }

Categories : HTML

After logout,how to redirect user to login page when he/she will click back button of browser in ASP.NET MVC3
Try: if(!User.Identity.IsAuthenticated) { RedirectToAction("Index", "Home"); } and use the [Authorize] data annotation on the required actions. You should be doing something like that for all your pages that require a user to be logged in anyway. Hope it helps.

Categories : C#

TideSDK Notifications in OSX Lion 10.7.5
Harry, I'm not too familiar with CoffeeScript, but the following code works for me in 10.7.5 and 10.8.4 - it seems similar to what you have: function showNotify(title, message) { var notification = Ti.Notification.createNotification({ 'title': title || 'No Title', 'message': message || 'No Message', 'timeout': 10 }); notification.show(); } showNotify("The Title", "The Message"); Hope it helps.

Categories : Misc

Installing JDK on OSX Lion for Scala
Scala is a popular enough of a language for there to be plenty of information on how to get started from scratch. For example, googling for "scala installation" gave me (amongst other stuff) http://www.tutorialspoint.com/scala/scala_environment_setup.htm —they talk about JVM versions, how to install Scala, etc; i.e. all you need. If that page won't do, I'm sure you'll find many more.

Categories : Scala

Will it be possible to upload to App Store from Lion?
Your Lion will be just fine as stated here: https://developer.apple.com/support/ios/ios-dev-center.html "To develop with the iOS SDK and Xcode, you must have an Intel-based Mac running Mac OS X Snow Leopard or later and you must be registered as an Apple Developer." Update July 2015 https://developer.apple.com/support/enrollment/ You must have an Intel-based Mac running OS X Yosemite (v10.10) or later.

Categories : IOS

R - OSX Mountain Lion and CPU Limit
Tried ulimit... Appears I do not have access, even via sudo. I get the same output from ulimit -a -H before and after giving ulimit -t 12000 # sets cputime limit to 12000 seconds from 600 seconds SOLVED via Debian Virtual Machine. If someone has a Mountain Lionic solution, please let us know.

Categories : R

Two versions of PHP - Mountain Lion
Your Apache is including libphp5.so of the wrong/the other installation. Option 1: See if you can find a libphp5.so file for your other PHP installation and point the Apache config to it (just put the whole path in the LoadModule line and restart Apache). If you cannot find such a file, the Apache module wasn't compiled for that PHP version. Compiling that may be a bit complicated, so in that case: Option 2: Figure out which PHP you're executing on the command line using which php and then just use the other one using the full path, e.g. instead of $ php ... use $ /usr/bin/php .... Note that you may still have different PHP configuration files for Apache and the CLI.

Categories : PHP

MAC OSX LION: gcc on mac not compiling wget
Honestly, even though it appears that gcc exists; but does it point to a valid install? It still sounds like it is not installed properly and with an upgrade to Mountain Lion, all your open source tools have been scrubbed away and pushed to Xcode and must be manually installed if necessary.

Categories : C++

SublimeClang OSX Mountain Lion C++11
It may be too late, but I found how to do it. This matter is because clang uses headers for gcc-4.2, which is quite old and doesn't support C++11. To complete C++11 code, you have to get newer gcc and copy the include path it uses. If you have homebrew, open terminal and type brew tap homebrew/versions brew install gcc48 You can install gcc-4.8 and new libstdc++ with these two lines. Now, create some c++ file and try to use g++-4.8 with -v option. g++-4.8 -v example.cpp -v option tell gcc to show detailed log. In the output, there should be some lines like this. #include <...> search starts here: /usr/local/Cellar/gcc48/4.8.1/gcc/lib/gcc/x86_64-apple-darwin12.4.1/4.8.1/../../../../include/c++/4.8.1 /usr/local/Cellar/gcc48/4.8.1/gcc/lib/gcc/x86_64-apple-darwin12.4.1/4.8.1/

Categories : C++

Mac OSX Lion/X11/CImg Library
The header file Xlib.h is in /opt/X11/include, so add that path to the Header Search Paths in Xcode: You'll probably need to add libraries from /opt/X11/lib as well...

Categories : Xcode

Does anybody know how to sniff in promiscuous mode on OS X Lion?
I recall having to setup a script on terminal to "tweak the permissions" of some files / drivers That's probably referring to the permissions on the /dev/bpf* devices. That's not something necessary to sniff in promiscuous mode, it's something necessary to sniff at all unless you're running as root. Recent versions of Wireshark, going back at least to Wireshark 1.8.0, install a script to do that automatically. Open up a Terminal window and do ls -l /dev/bpf*; it should report the /dev/bpf* devices, e.g. /dev/bpf0, /dev/bpf1, etc. as having permissions rw-rw---- and as being owned by root and group access_bpf. In addition, the id command should report you as being a member of group access_bpf. If that's all the case, Wireshark should show an en0 device and possibly an en1 device.

Categories : Osx

How can I install pybrain on Mac OS X Mountain Lion?
Try using the Python package manager pip with the correct permissions: pip install pybrain or clone the repo and build the package git clone git://github.com/pybrain/pybrain.git python setup.py install

Categories : Python

Installing jpype in Mountain Lion
This is on a system running OSX 10.8.5. I modified the setup.py for JPype-0.5.4.2 and added an element to the end of the self.includeDirs list which is created in the function setupInclusion. This function is declared at line 61 for this particular version of JPype. def setupInclusion(self): self.includeDirs = [ self.javaHome+"/include", self.javaHome+"/include/"+self.jdkInclude, "src/native/common/include", "src/native/python/include", #I added this line below. The folder contains a jni.h "/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" ] Finally I ran pip install ~/Path/To/JPype-folder/ and the installation was successful.

Categories : Java

Can't Uninstall Java 7 JDK on Mac OS X (Mountain Lion 10.8.4)
If you can't find the Java Home, open up terminal and enter: env look for or SOMETHING LIKE THIS Mine might not be the same as yours JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.7/Home This is where your Java is installed If you want to see it in Finder then open up Finder and press Command + Shift + G and enter in the path to java home. to uninstall simply remove the java version from : /System/Library/Java/JavaVirtualMachines with cd /System/Library/Java/JavaVirtualMachines rm -r some.version.java.jdk Note: Sometimes Java is install in /System/Library but sometimes it's installed on /Library, so that's why you couldn't find Java in /Library which the Oracle document suggested.

Categories : Osx

Mac OS X Lion - mysql: command not found
In the past I've had problems installing the mysql2 gem, so I wrote a little shell script to make my life easier: #!/bin/sh -x env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Try updating that with the path to your mysql_config: /usr/local/Cellar/mysql/5.5.28/bin/mysql_config and change mysql to mysql2.

Categories : Mysql

Where are the files generated with Xcode 4.5 in Lion?
This has nothing to do with Lion. Xcode puts generated files in: ~/Library/Developer/Xcode/DerivedData where ~ is your home directory. Keep in mind that the ~/Library directory is hidden by default in Lion (and later).

Categories : Xcode

Mac Lion: Issue with opencv and python 2.7.5
This is how I configured it in the end for the official python 2.7.5 from http://www.python.org First we need to install opencv via brew: brew tap homebrew/science brew install opencv now add /usr/local/Cellar/opencv/2.4.5/lib/python2.7/site-packages to your PYTHONPATH . I did it by editing bash_profile: open ~/.bash_profile add this line in TextEditor: export PYTHONPATH=/usr/local/Cellar/opencv/2.4.5/lib/python2.7/site-packages:$PYTHONPATH #Check the version in your directory Save the file and do: source ~/.bash_profile Now everything should be ready.

Categories : Python

Installing Cloudera Hue on mac os x mountain lion
You need to delete desktop/core/ext-py/Twisted and retry. Also Hue 2.5 release (which contains this fix) is around the corner (this Monday/Tuesday).

Categories : Osx

How do I create a .conf file in Mac osx Lion?
Open TextEdit's Preferences, and switch to the Open and Save section. Under the When Saving a File panel, uncheck the Add '.txt' extension to plain text files option.

Categories : Osx

Tesseract and dylib on OSX Mountain Lion
Done by cleaning my installation of both the softwares and re-installing them through brew. Mind that if there is some linking problem, you have to execute brew link --overwrite tesseract to solve them.

Categories : Misc

Mono Program Crashes on OSX Lion
This might be a problem of where you built it: try building it in Lion instead to see if that makes a difference. I've seen problems before when trying to execute a program on an older OS than where it was built.

Categories : C#

Which Python architecture provided on Mac (Lion)?
Use platform.architecture(): >>> import platform >>> platform.architecture() ('64bit', '') Run on my Mac OS X 10.8.4. Note that your Python executable may be a universal binary, in which case you could get the wrong architecture quoted: Note: On Mac OS X (and perhaps other platforms), executable files may be universal files containing multiple architectures. You can also test sys.maxsize: >>> sys.maxsize > 2**32 True The above would return False if you were running a 32-bit platform.

Categories : Python

RabbitMQ not working on OS X Mountain Lion
I've managed to fix this issue by completely removing brew from my system and reinstalling it again. I've used the following instructions (adapted from the official brew documentation) to completely remove brew from my system: cd `brew --prefix` rm -rf Cellar brew prune rm -r Library/Homebrew rm -rf .git rm -rf ~/Library/Caches/Homebrew I simply reinstalled RabbitMQ afterwards: brew install rabbitmq .. and everything worked like a charm!

Categories : Osx



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.